Title: Bitcoin walletnotify's confirmations number can be increased? Post by: wsxdrfv on June 14, 2018, 05:52:40 AM So at bitcoin.conf file, there we can set walletnotify option, and it only called when some transaction's confirmations are 0 and 1.
Can we increase this number? If can't, we should revise coin's source code itself? where? Title: Re: Bitcoin walletnotify's confirmations number can be increased? Post by: starmyc on June 14, 2018, 06:06:04 AM So at bitcoin.conf file, there we can set walletnotify option, and it only called when some transaction's confirmations are 0 and 1. Can we increase this number? If can't, we should revise coin's source code itself? where? There is a wallet notification only when there is a wallet change, which happens when a new transaction enters the mempool (confirmation is 0) and when it enters the chain (confirmation will be 1). In the case you want to have a notification when confirmation number reaches another number, like 6, the best is to keep track in a database confirmed transactions and to use -blocknotify to have a notification when a new blocks comes in. With those information, you'll be able to compute how much confirmation a transaction has (eg: current block number minus the transaction's block number). Pseudo code: Code: In tx notify script: Title: Re: Bitcoin walletnotify's confirmations number can be increased? Post by: achow101 on June 14, 2018, 06:28:17 AM Can we increase this number? No.If can't, we should revise coin's source code itself? where? You can't, not without modifying a lot of code. It's almost all in https://github.com/bitcoin/bitcoin/blob/master/src/wallet/wallet.cpp. Bitcoin Core does not actually track the number of confirmations for a transaction; there is no trigger for that. Rather it just records the block height the block including a transaction was found and calculates the confirmations from the current block height. You will need to add something which, for each block, checks all known transactions in the wallet, calculates their confirmations, and triggers walletnotify for transactions at whatever confirmation count. |