diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-01-08 15:19:59 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-01-08 15:20:34 +0100 |
commit | 295211e668290d7741eb0fd46223087c21fc7c59 (patch) | |
tree | 4659dc2075ae5901540f81e2ea0e268278da2df8 /src | |
parent | 7f3675b3ce2a67e09e5d43c2c42a91112c26bdad (diff) | |
parent | 3e730bf90aaf53c41ff3a778f6aac15d163d1c0c (diff) | |
download | bitcoin-295211e668290d7741eb0fd46223087c21fc7c59.tar.xz |
Merge #17445: zmq: Fix due to invalid argument and multiple notifiers
3e730bf90aaf53c41ff3a778f6aac15d163d1c0c zmq: Fix due to invalid argument and multiple notifiers (João Barbosa)
Pull request description:
ZMQ initialization is interrupted if any notifier fails, and in that case all notifiers are destroyed. The notifier shutdown assumes that the initialization had occurred. This is not valid when there are multiple notifiers and any except the last fails to initialize.
Can be tested by running test/functional/interface_zmq.py from this branch with bitcoind from master.
Closes #17185.
ACKs for top commit:
laanwj:
Code review ACK 3e730bf90aaf53c41ff3a778f6aac15d163d1c0c, thanks for adding a test
Tree-SHA512: 5da710e97dcbaa94896d019e75162d470f6d381ee07c60e5b3e9db93d11e8f7ca9bf2c509efa4486199e88c96c3e720cc96b4e35b62725d4c7db8e8e9bf6e09d
Diffstat (limited to 'src')
-rw-r--r-- | src/zmq/zmqpublishnotifier.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/zmq/zmqpublishnotifier.cpp b/src/zmq/zmqpublishnotifier.cpp index 0dab6a06d5..344a7321f9 100644 --- a/src/zmq/zmqpublishnotifier.cpp +++ b/src/zmq/zmqpublishnotifier.cpp @@ -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); |