[depends, zmq, doc] avoid deprecated zeromq api functions
Zcash: Backported from bitcoin/bitcoin#13578
This commit is contained in:
parent
92aa4d6178
commit
edfb4d98e7
|
@ -33,9 +33,10 @@ buffering or reassembly.
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
The ZeroMQ feature in Zcash requires ZeroMQ API version 4.x or
|
The ZeroMQ feature in Zcash requires the ZeroMQ API >= 4.0.0
|
||||||
newer, which you will need to install if you are not using the depends
|
[libzmq](https://github.com/zeromq/libzmq/releases), which you will
|
||||||
system. Typically, it is packaged by distributions as something like
|
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.
|
*libzmq5-dev*. The C++ wrapper for ZeroMQ is *not* needed.
|
||||||
|
|
||||||
In order to run the example Python client scripts in contrib/ one must
|
In order to run the example Python client scripts in contrib/ one must
|
||||||
|
|
|
@ -73,10 +73,14 @@ CZMQNotificationInterface* CZMQNotificationInterface::CreateWithArguments(const
|
||||||
// Called at startup to conditionally set up ZMQ socket(s)
|
// Called at startup to conditionally set up ZMQ socket(s)
|
||||||
bool CZMQNotificationInterface::Initialize()
|
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");
|
LogPrint("zmq", "zmq: Initialize notification interface\n");
|
||||||
assert(!pcontext);
|
assert(!pcontext);
|
||||||
|
|
||||||
pcontext = zmq_init(1);
|
pcontext = zmq_ctx_new();
|
||||||
|
|
||||||
if (!pcontext)
|
if (!pcontext)
|
||||||
{
|
{
|
||||||
|
@ -119,7 +123,7 @@ void CZMQNotificationInterface::Shutdown()
|
||||||
LogPrint("zmq", " Shutdown notifier %s at %s\n", notifier->GetType(), notifier->GetAddress());
|
LogPrint("zmq", " Shutdown notifier %s at %s\n", notifier->GetType(), notifier->GetAddress());
|
||||||
notifier->Shutdown();
|
notifier->Shutdown();
|
||||||
}
|
}
|
||||||
zmq_ctx_destroy(pcontext);
|
zmq_ctx_term(pcontext);
|
||||||
|
|
||||||
pcontext = 0;
|
pcontext = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue