[depends, zmq, doc] avoid deprecated zeromq api functions

Zcash: Backported from bitcoin/bitcoin#13578
This commit is contained in:
mruddy 2018-06-30 10:32:33 -04:00 committed by Jack Grigg
parent 92aa4d6178
commit edfb4d98e7
2 changed files with 10 additions and 5 deletions

View File

@ -33,9 +33,10 @@ buffering or reassembly.
## Prerequisites
The ZeroMQ feature in Zcash requires ZeroMQ API version 4.x or
newer, which you will need to install if you are not using the depends
system. Typically, it is packaged by distributions as something like
The ZeroMQ feature in Zcash requires the ZeroMQ API >= 4.0.0
[libzmq](https://github.com/zeromq/libzmq/releases), which you will
need to install if you are not using the depends system.
Typically, it is packaged by distributions as something like
*libzmq5-dev*. The C++ wrapper for ZeroMQ is *not* needed.
In order to run the example Python client scripts in contrib/ one must

View File

@ -73,10 +73,14 @@ CZMQNotificationInterface* CZMQNotificationInterface::CreateWithArguments(const
// 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("zmq", "zmq: version %d.%d.%d\n", major, minor, patch);
LogPrint("zmq", "zmq: Initialize notification interface\n");
assert(!pcontext);
pcontext = zmq_init(1);
pcontext = zmq_ctx_new();
if (!pcontext)
{
@ -119,7 +123,7 @@ void CZMQNotificationInterface::Shutdown()
LogPrint("zmq", " Shutdown notifier %s at %s\n", notifier->GetType(), notifier->GetAddress());
notifier->Shutdown();
}
zmq_ctx_destroy(pcontext);
zmq_ctx_term(pcontext);
pcontext = 0;
}