1
I am running my bitcoind with -zmqpubhashtx optional, and I receive notification once a new transaction has broadcast to public chain! I can also parser it by getrawtransaction and decoderawtransaction. But I couldn't validated if a transaction is confirmed.
Additionally, there are also exists an optional name as -zmqpubhashblock, I can also parser it by getblock and read its all transactions, compare it all with my MySQL data, if it's exists with the same txid, I'll update my column (confirmations to plus one), but it's a little bit ineffective.
Let's say, After I ran getblock <hash>, and then give me a tons of transaction. and I have to check each something like:
UPDATE t_unspent_tx
SET confirmations = confirmations + 1
WHERE addr in (addresses)
BTW, Can I trust the block hash from notification? Is it may not be the longest on the chain?
PS, I don't want to check confirmation from the blockchain.info or some other site else.
Oh! I am definitely sure there is no
confirmationsafter you decode thehex, which get bygetrawtransaction. – Frank AK – 2018-08-01T09:07:53.503Seems to work on chainquery. What version of Bitcoin are you running? – Raghav Sood – 2018-08-01T09:10:38.730
I am using the
V0.16.1version. The link that you given should be processed. – Frank AK – 2018-08-01T09:13:18.947It also seems to be in the source. Not sure why it won't show up on your local node. Are you sure you're using
getrawtransaction, and notdecoderawtransaction? – Raghav Sood – 2018-08-01T09:21:07.580Oh! getrawtransaction only return me a hash, and I have to use
decoderawtransactionto parser it. – Frank AK – 2018-08-01T09:22:34.960getrawtransactionhas a verbose mode, as described in my answer, use that instead – Raghav Sood – 2018-08-01T09:23:08.503