Skip to content

Instantly share code, notes, and snippets.

@afk11
Last active January 30, 2020 16:39
Show Gist options
  • Save afk11/b6323cc4ae8c91e35f9f8c15280ffe5c to your computer and use it in GitHub Desktop.
Save afk11/b6323cc4ae8c91e35f9f8c15280ffe5c to your computer and use it in GitHub Desktop.
Default behaviour of bitcoind ZMQ notifications during reorg
Default behaviour
rawtx tx1 <- TransactionAddedToMempool
rawtx tx2 <- TransactionAddedToMempool
rawtx tx3 <- TransactionAddedToMempool
rawtx blka1CoinBase <- BlockConnected
rawtx tx1 <- BlockConnected
rawtx tx2 <- BlockConnected
rawtx tx3 <- BlockConnected
rawblock blk1a (tx1, tx2, tx3) <- UpdatedTip
(background, send block1b EMPTY) (noop)
(background, send block2b tx1, tx2, tx3)** bitcoind's reorg triggered after this
rawtx blk1aCoinBase <- BlockDisconnect
rawtx tx1 <- BlockDisconnect
rawtx tx2 <- BlockDisconnect
rawtx tx3 <- BlockDisconnect
rawtx blk1bCoinBase <- BlockConnect
rawtx blk2bCoinBase <- BlockConnect
rawtx tx1 <- BlockConnect
rawtx tx2 <- BlockConnect
rawtx tx3 <- BlockConnect
rawblock blk2b (tx1, tx2, tx3) <- UpdatedTip **when we learn about reorg
** this is when we would start unconfirming block1a **
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment