bitcore-node icon indicating copy to clipboard operation
bitcore-node copied to clipboard

On which events does bitcoind/addresstxid send transaction?

Open karelbilek opened this issue 9 years ago • 6 comments

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.

karelbilek avatar Jul 08 '16 16:07 karelbilek

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.

karelbilek avatar Jul 08 '16 16:07 karelbilek

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)

braydonf avatar Jul 08 '16 17:07 braydonf

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 :)

karelbilek avatar Jul 11 '16 01:07 karelbilek

Yes, it's from bitcoind zmq tx event, and https://github.com/bitpay/bitcore-node/blob/master/lib/services/bitcoind.js#L617-L652

braydonf avatar Jul 11 '16 14:07 braydonf

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 avatar Apr 09 '17 04:04 m19

@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.

RobertBaron avatar Apr 13 '17 03:04 RobertBaron