Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge #13578: [depends, zmq, doc] upgrade zeromq to 4.2.5 and avoid deprecated zeromq api functions #4397

Merged
merged 1 commit into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions depends/packages/zeromq.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package=zeromq
$(package)_version=4.2.3
$(package)_version=4.2.5
$(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=8f1e2b2aade4dbfde98d82366d61baef2f62e812530160d2e6d0a5bb24e40bc0
$(package)_sha256_hash=cc9090ba35713d59bb2f7d7965f877036c49c5558ea0c290b0dcc6f2a17e489f

define $(package)_set_vars
$(package)_config_opts=--without-docs --disable-shared --disable-curve --disable-curve-keygen --disable-perf --disable-Werror --disable-drafts
Expand Down
6 changes: 4 additions & 2 deletions doc/zmq.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ buffering or reassembly.

## Prerequisites

The ZeroMQ feature in Dash Core requires ZeroMQ API version 4.x or
newer. Typically, it is packaged by distributions as something like
The ZeroMQ feature in Dash Core requires the ZeroMQ API >= 4.0.0
[libzmq](https://github.com/zeromq/libzmq/releases).
For version information, see [dependencies.md](dependencies.md).
Typically, it is packaged by distributions as something like
*libzmq3-dev*. The C++ wrapper for ZeroMQ is *not* needed.

In order to run the example Python client scripts in the `contrib/zmq/`
Expand Down
8 changes: 6 additions & 2 deletions src/zmq/zmqnotificationinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,14 @@ CZMQNotificationInterface* CZMQNotificationInterface::Create()
// Called at startup to conditionally set up ZMQ socket(s)
bool CZMQNotificationInterface::Initialize()
{
int major = 0, minor = 0, patch = 0;
zmq_version(&major, &minor, &patch);
LogPrint(BCLog::ZMQ, "zmq: version %d.%d.%d\n", major, minor, patch);

LogPrint(BCLog::ZMQ, "zmq: Initialize notification interface\n");
assert(!pcontext);

pcontext = zmq_init(1);
pcontext = zmq_ctx_new();

if (!pcontext)
{
Expand Down Expand Up @@ -117,7 +121,7 @@ void CZMQNotificationInterface::Shutdown()
LogPrint(BCLog::ZMQ, "zmq: Shutdown notifier %s at %s\n", notifier->GetType(), notifier->GetAddress());
notifier->Shutdown();
}
zmq_ctx_destroy(pcontext);
zmq_ctx_term(pcontext);

pcontext = nullptr;
}
Expand Down