zmq: Fix due to invalid argument and multiple notifiers

Github-Pull: #17445
Rebased-From: 3e730bf90aaf53c41ff3a778f6aac15d163d1c0c
This commit is contained in:
João Barbosa 2019-11-11 22:21:43 +00:00
parent bb123c6527
commit 179d55f052
2 changed files with 6 additions and 1 deletions

View file

@ -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);

View file

@ -59,6 +59,10 @@ class ZMQTest (BitcoinTestFramework):
# 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)