Using walletnotify for confirmed transactions

+4 votes
When a transaction is "confirmed", walletnotify executes a bash script. What does it mean exactly to say that a transaction is "confirmed"? Does it mean that the transaction has been mined into a block? Is it therefore synchronised across all nodes? (ie all nodes have consensus about that transaction)

Second to this, if walletnotify is enabled for another node, will the script execute once this new transaction appears on its copy of the blockchain? (My use-case is data stream items)


asked Mar 27, 2018 by charlieasmith96

1 Answer

+1 vote

A transaction is "confirmed" when it is included in a block which is need by that node. There is no guarantee that every single other node has seen the same block. If you want to be notified when items are more strongly confirmed than this, you might want to consider using blocknotify, and whenever a new block appears, do some processing on the items which are a certain number of blocks behind that one (see liststreamblockitems).

answered Mar 28, 2018 by MultiChain
When you say more strongly confirmed, do you mean that it is more likely for all nodes to have consensus about the validity of that block?
Yes, more likely that all nodes will have consensus that that block is confirmed in the chain.