On which events does bitcoind/addresstxid send transaction?
When I subcribe to bitcoind/addresstxid event, on which events will I be notified?
In bitcore 2, I think I was notified on
- when the transaction was first seen (in mempool)
- when the transaction was confirmed
- when the transaction was removed from mempool for other reason
However, I am not really sure if I now get notified on the latter two with the new bitcoind/addresstxid event.
I feel like sometimes I don't get notified on confirmation, but sometimes I do.
I have no way to test "other" removal from mempool now.
From what I remember:
- There is an event when the transaction enters the mempool
- There is an event for a transaction was in a block that had not already been sent previously (all coinbase transactions for example will be sent here)
Where is the logic implemented? It seems it comes from bitcoind, right? Since I cannot find it in bitcore-node source
And again, it would be nice to document this more exactly :)
Yes, it's from bitcoind zmq tx event, and https://github.com/bitpay/bitcore-node/blob/master/lib/services/bitcoind.js#L617-L652
Huge bump, apologies.
Does anyone have suggestions on receiving an event on first confirmation? In my mind the best way is to store the txid and then check if the txid is included in every new block. Any ideas?
@m19 so, transactions on new blocks have 1 confirmation, instead of looking at the transactions you can "listen" to new blocks New block => tx.confirmation = 1
That will be for me the easiest way instead of implementing custom logic for it, bitcore-node already has an event for new blocks.
Or can you detail a little better on the purpose of why u want that?
- Sorry for my bad english, not native speaker.