I am trying to enable ZMQ by adding the following options to my bitcoin.conf:
0zmqpubrawblock=tcp://127.0.0.1:28332
1zmqpubrawtx=tcp://127.0.0.1:28333
However, when I start bitcoind with these options I get the following error:
0bitcoind: zmq/zmqpublishnotifier.cpp:104: virtual void CZMQAbstractPublishNotifier::Shutdown(): Assertion `psocket' failed.
For what it’s worth, this only seems to happen when I have both zmqpubrawblock and zmqpubrawtx enabled as options, but individually they work fine. For example:
0bitcoind --testnet -zmqpubrawblock=tcp://127.0.0.1:28332 # this works
1bitcoind --testnet -zmqpubrawtx=tcp://127.0.0.1:28333 # this works
2bitcoind --testnet -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28333 # error
I’ve been following the guide at https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md, but it doesn’t seem to explain why this is happening.
What could be causing this error? Thanks in advance for any advice.
EDIT: I tried to recreate this error on a different computer and the config works without error. I believe there may be an issue with the bitcoin.conf on the other computer. I will compare the two bitcoin.conf files to see if I can spot what may be causing this error.
Nonetheless, I’d still be very interested in understanding what this particular error message indicates.
EDIT 2: I believe this error may be caused due to multiple ZMQs using the same port at the same time (e.g. running bitcoind and bitcoind -testnet at the same time, and both are using the same bitcoin.conf with the same ZMQ ports set).
Will check the ports on the other computer with ss -lntp to see if they’re in use.