Title: [JSON-RPC] Detecting RBF and CPFP with "listtransactions" Post by: Lionel on December 22, 2017, 10:33:23 PM I need to detect the coin deposits to a given address, and i do it with listtransactions
The manual https://bitcoin.org/en/developer-reference#listtransactions says that "conflicted" transactions appear with -1 confirmations. Quote → → 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 Quote → → 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 Title: Re: [JSON-RPC] Detecting RBF and CPFP with "listtransactions" Post by: achow101 on December 22, 2017, 11:07:14 PM A CPFP transaction is not a conflict and does not result in any additional transactions being listed in your wallet unless you are the one performing the CPFP. It does not affect you.
The safest thing for you to do would be to wait for one confirmation. After one confirmation, it does not matter whether a transaction was RBF'd or not; the conflicting transaction will be unconfirmed and you aren't counting those. Title: Re: [JSON-RPC] Detecting RBF and CPFP with "listtransactions" Post by: Anti-Cen on December 22, 2017, 11:49:38 PM Well you have done better than me if you managed to talk to any nodes on port 8333 using sockets and code you wrote yourself.
I just wanted to sent of a TCP byte stream to make a request to return other nodes on the network and didn't get anywhere after a day of trying Are you just using RPC to talk to the local node and then letting that do all the work because I don't want to run a full node on the machine but from what I have seen it would be easier to give birth to an elephant than do the little job that i wanted to do. Title: Re: [JSON-RPC] Detecting RBF and CPFP with "listtransactions" Post by: Lionel on December 23, 2017, 02:27:22 PM Well you have done better than me if you managed to talk to any nodes on port 8333 using sockets and code you wrote yourself. I just wanted to sent of a TCP byte stream to make a request to return other nodes on the network and didn't get anywhere after a day of trying Are you just using RPC to talk to the local node and then letting that do all the work because I don't want to run a full node on the machine but from what I have seen it would be easier to give birth to an elephant than do the little job that i wanted to do. Yes i am running a local full node. An easier but resource-intensive way :) @achow101 Thanks! I may want to tip you but the network fees discourage me :D If you have an LTC or BCH wallet it's better |