I need to detect the coin deposits to a given address, and i do it with
listtransactionsThe manual
https://bitcoin.org/en/developer-reference#listtransactionssays that "conflicted" transactions appear with -1 confirmations.
→ →
confirmations | number (int) | Optional | (0 or 1) |
The number of confirmations the transaction has received. Will be 0 for unconfirmed and -1 for conflicted. Not returned for move category payments
And also it says that the "walletconflicts" field would be non-empty if other transactions spend the same UTXO
→ →
walletconflicts array Optional
(0 or 1) An array containing the TXIDs of other transactions that spend the same inputs (UTXOs) as this transaction. Array may be empty. Not returned for move category payments
Then how can i check if a transaction is an "original" one , and not just an RBF or CPFP of another tx ?
If i don't do that, i risk counting some amount deposits twice , i.e. i would count RBF/CPFP transactions as well.
IMO i should just see if the confirmations are >= 1 , because an RBF/CPFP transaction would have -1 confirmations.
Or maybe check if "walletconflicts" is empty
What do you think?
Thanks
p.s. Maybe there's no problem with RBF , as an RBF transaction actually replaces the original transaction in the mempool of all the nodes, so that it becomes the original one, right?
Then i should only worry about CPFP