From e2e7393d0b14b994554c0fbfbcad0c833d752a0f Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 1 Jul 2018 22:19:30 -0500 Subject: [PATCH] implement changes in zmq_sub.py, update the doc, and change argument name to fix typo --- contrib/zmq/zmq_sub.py | 9 +++++++++ doc/zmq.md | 2 ++ src/zmq/zmqnotificationinterface.cpp | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/contrib/zmq/zmq_sub.py b/contrib/zmq/zmq_sub.py index 81873feffdd57..f0823d071f492 100755 --- a/contrib/zmq/zmq_sub.py +++ b/contrib/zmq/zmq_sub.py @@ -17,6 +17,8 @@ zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"rawblock") zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"rawtx") zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"rawtxlock") +zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashgovernancevote") +zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashgovernanceobject") zmqSubSocket.connect("tcp://127.0.0.1:%i" % port) try: @@ -48,6 +50,13 @@ elif topic == "rawtxlock": print('- RAW TX LOCK ('+sequence+') -') print(binascii.hexlify(body).decode("utf-8")) + elif topic == "hashgovernancevote": + print('- HASH GOVERNANCE VOTE ('+sequence+') -') + print(binascii.hexlify(body).decode("utf-8")) + elif topic == "hashgovernanceobject": + print('- HASH GOVERNANCE OBJECT ('+sequence+') -') + print(binascii.hexlify(body).decode("utf-8")) + except KeyboardInterrupt: zmqContext.destroy() diff --git a/doc/zmq.md b/doc/zmq.md index a708ca5ab6669..845fec25c0e7e 100644 --- a/doc/zmq.md +++ b/doc/zmq.md @@ -62,6 +62,8 @@ Currently, the following notifications are supported: -zmqpubrawblock=address -zmqpubrawtx=address -zmqpubrawtxlock=address + -zmqpubhashgovernancevote=address + -zmqpubhashgovernanceobject=address The socket type is PUB and the address must be a valid ZeroMQ socket address. The same address can be used in more than one notification. diff --git a/src/zmq/zmqnotificationinterface.cpp b/src/zmq/zmqnotificationinterface.cpp index edf127d3ee40c..5baad60247bec 100644 --- a/src/zmq/zmqnotificationinterface.cpp +++ b/src/zmq/zmqnotificationinterface.cpp @@ -41,8 +41,8 @@ CZMQNotificationInterface* CZMQNotificationInterface::Create() factories["pubrawblock"] = CZMQAbstractNotifier::Create; factories["pubrawtx"] = CZMQAbstractNotifier::Create; factories["pubrawtxlock"] = CZMQAbstractNotifier::Create; - factories["pubghashvote"] = CZMQAbstractNotifier::Create; - factories["pubghashobject"] = CZMQAbstractNotifier::Create; + factories["pubhashgovernancevote"] = CZMQAbstractNotifier::Create; + factories["pubhashgovernanceobject"] = CZMQAbstractNotifier::Create; for (std::map::const_iterator it=factories.begin(); it!=factories.end(); ++it) {