Bitcoin Forum
September 23, 2018, 01:21:57 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [JSON-RPC] Detecting RBF and CPFP with "listtransactions"  (Read 39 times)
Lionel
Sr. Member
****
Offline Offline

Activity: 503
Merit: 264


View Profile
December 22, 2017, 10:33:23 PM
 #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
1537708917
Hero Member
*
Offline Offline

Posts: 1537708917

View Profile Personal Message (Offline)

Ignore
1537708917
Reply with quote  #2

1537708917
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1537708917
Hero Member
*
Offline Offline

Posts: 1537708917

View Profile Personal Message (Offline)

Ignore
1537708917
Reply with quote  #2

1537708917
Report to moderator
1537708917
Hero Member
*
Offline Offline

Posts: 1537708917

View Profile Personal Message (Offline)

Ignore
1537708917
Reply with quote  #2

1537708917
Report to moderator
1537708917
Hero Member
*
Offline Offline

Posts: 1537708917

View Profile Personal Message (Offline)

Ignore
1537708917
Reply with quote  #2

1537708917
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1650


3F1Y9yquzvY6RWvKbw2n2zeo9V5mvBhADU


View Profile WWW
December 22, 2017, 11:07:14 PM
 #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: 196
Merit: 25

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
Sr. Member
****
Offline Offline

Activity: 503
Merit: 264


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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!