Skip to content

Commit

Permalink
zmq: Fix due to invalid argument and multiple notifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
promag committed Nov 11, 2019
1 parent 80fdb6f commit 3e730bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/zmq/zmqpublishnotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ bool CZMQAbstractPublishNotifier::Initialize(void *pcontext)

void CZMQAbstractPublishNotifier::Shutdown()
{
assert(psocket);
// Early return if Initialize was not called
if (!psocket) return;

int count = mapPublishNotifiers.count(address);

Expand Down
4 changes: 4 additions & 0 deletions test/functional/interface_zmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def test_basic(self):
# Note that the publishing order is not defined in the documentation and
# is subject to change.
import zmq

# Invalid zmq arguments don't take down the node, see #17185.
self.restart_node(0, ["-zmqpubrawtx=foo", "-zmqpubhashtx=bar"])

address = 'tcp://127.0.0.1:28332'
socket = self.ctx.socket(zmq.SUB)
socket.set(zmq.RCVTIMEO, 60000)
Expand Down

0 comments on commit 3e730bf

Please sign in to comment.