Bitcoin Forum
May 22, 2024, 02:39:34 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Transaction tracking with listsinceblock  (Read 918 times)
bukaj (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
May 05, 2013, 01:23:07 PM
 #1

Hi, I'm trying to track incomming transactions using bitcoind RPC API, --blocknotify and listsinceblock:

0. wait for --blocknotify hint
1. execute listsinceblock blockhash, 6 (target-confirmations), where blockhash is empty if running for the first time or lastblock returned by listsinceblock last time (step 3)
2. save to database transactions with confirmations >= 6 and with txid not already in database
3. remember lastblock returned by listsinceblock
4. goto 0

It is working fine and thanks to listsinceblock target-confirmation parameter lastblock is correctly shifted by 6 so I don't ommit any transactions.

If I understand correctly during chain fork blocks are lost and listsinceblock will return all transactions again because lastblock won't exist in new blockchain.

Questions:

A. Is it safe to rely on txid while ignoring already imported transactions in such situation?

B. I should also delete already imported transactions not existing in new blockchain, how to detect block chain fork easily using bitcoind RPC API?

C. Should I worry about it if accepting only txs with 6 confirmations?
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!