Bitcoin Forum
April 19, 2024, 11:50:25 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [JSON-RPC] Detecting RBF and CPFP with "listtransactions"  (Read 151 times)
Lionel (OP)
Sr. Member
****
Offline Offline

Activity: 613
Merit: 305


View Profile
December 22, 2017, 10:33:23 PM
Last edit: December 22, 2017, 10:55:26 PM by Lionel
Merited by ABCbits (2)
 #1

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
1713527425
Hero Member
*
Offline Offline

Posts: 1713527425

View Profile Personal Message (Offline)

Ignore
1713527425
Reply with quote  #2

1713527425
Report to moderator
1713527425
Hero Member
*
Offline Offline

Posts: 1713527425

View Profile Personal Message (Offline)

Ignore
1713527425
Reply with quote  #2

1713527425
Report to moderator
"Bitcoin: mining our own business since 2009" -- Pieter Wuille
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713527425
Hero Member
*
Offline Offline

Posts: 1713527425

View Profile Personal Message (Offline)

Ignore
1713527425
Reply with quote  #2

1713527425
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3374
Merit: 6511


Just writing some code


View Profile WWW
December 22, 2017, 11:07:14 PM
Merited by ABCbits (2)
 #2

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.

Anti-Cen
Member
**
Offline Offline

Activity: 210
Merit: 26

High fees = low BTC price


View Profile
December 22, 2017, 11:49:38 PM
 #3

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.


Mining is CPU-wars and Intel, AMD like it nearly as much as big oil likes miners wasting electricity. Is this what mankind has come too.
Lionel (OP)
Sr. Member
****
Offline Offline

Activity: 613
Merit: 305


View Profile
December 23, 2017, 02:27:22 PM
 #4

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 Smiley

@achow101 Thanks!
I may want to tip you but the network fees discourage me Cheesy
If you have an LTC or BCH wallet it's better
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!