lnd: [bug]: RegisterBlockEpochNtfn is sending the same event twice
Background
RegisterBlockEpochNtfn is sending 2 events (same data) for block updates
Your environment
- version of
lnd: 0.16.2-beta - operating system: Linux
- version of
bitcoind: v24.0.1
Steps to reproduce
use code provided here https://lightning.engineering/api-docs/api/lnd/chain-notifier/register-block-epoch-ntfn or use Alex Library https://github.com/alexbosworth/ln-service#subscribetoblocks
Expected behaviour
Send only 1 event per block
Actual behaviour
Send 2 events per block (same data)
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15 (5 by maintainers)
Closing this as I’m pretty sure this is an issue of the specific fork/build of
bitcoindand notlnd.@dolcalmi I looked at the
Dockerfileforlncm/bitcoindand it looks like the ZMQ parameters are supplied as command line arguments: https://github.com/lncm/docker-bitcoind/blob/master/24.0/Dockerfile#L256 Maybe adding the same values in the config file actually creates two ZMQ endpoints under the same address which ends up pushing the events twice? No idea how ZMQ works under the hood, but if that is the case then you should be fine with just removing those two lines from yourbitcoin.confand things should work normally.Thank you for the test project. I now took a look at it and can say with a large degree of certainty that the multiple notifications happen because
lndthinks there is a re-org (the log lines I posted above).I changed to another
bitcoinddocker image and the problem was gone:So I’m pretty sure something in how ZMQ works is broken or different in your
lncmvariant of thebitcoinddocker image.I just took a quick look at the log file in your test and see this:
So it looks like your test is doing a re-org, in which case it would be expected to be notified about a block multiple times. So I’d say something is up with the test logic itself.