From 21b81d1d5921f7ec483dca3cb3f1d1d230d0f547 Mon Sep 17 00:00:00 2001 From: Michel van Kessel Date: Sun, 6 Dec 2020 21:54:21 +0100 Subject: [PATCH] some changes to zmq files --- src/zmq/zmqabstractnotifier.cpp | 4 ++-- src/zmq/zmqabstractnotifier.h | 2 +- src/zmq/zmqconfig.h | 6 +++--- src/zmq/zmqnotificationinterface.cpp | 18 ++++++++++-------- src/zmq/zmqnotificationinterface.h | 2 +- src/zmq/zmqpublishnotifier.cpp | 10 +++++----- src/zmq/zmqpublishnotifier.h | 4 ++-- 7 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/zmq/zmqabstractnotifier.cpp b/src/zmq/zmqabstractnotifier.cpp index 9f5cb3ba6..ce5c753eb 100644 --- a/src/zmq/zmqabstractnotifier.cpp +++ b/src/zmq/zmqabstractnotifier.cpp @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "zmqabstractnotifier.h" -#include "util.h" +#include +#include CZMQAbstractNotifier::~CZMQAbstractNotifier() diff --git a/src/zmq/zmqabstractnotifier.h b/src/zmq/zmqabstractnotifier.h index 77cf5141e..b86fe1071 100644 --- a/src/zmq/zmqabstractnotifier.h +++ b/src/zmq/zmqabstractnotifier.h @@ -5,7 +5,7 @@ #ifndef BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H #define BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H -#include "zmqconfig.h" +#include class CBlockIndex; class CZMQAbstractNotifier; diff --git a/src/zmq/zmqconfig.h b/src/zmq/zmqconfig.h index 610d7fbda..ce8f3e13d 100644 --- a/src/zmq/zmqconfig.h +++ b/src/zmq/zmqconfig.h @@ -6,7 +6,7 @@ #define BITCOIN_ZMQ_ZMQCONFIG_H #if defined(HAVE_CONFIG_H) -#include "config/bitcoin-config.h" +#include #endif #include @@ -16,8 +16,8 @@ #include #endif -#include "primitives/block.h" -#include "primitives/transaction.h" +#include +#include void zmqError(const char *str); diff --git a/src/zmq/zmqnotificationinterface.cpp b/src/zmq/zmqnotificationinterface.cpp index 870553242..6e91d39c8 100644 --- a/src/zmq/zmqnotificationinterface.cpp +++ b/src/zmq/zmqnotificationinterface.cpp @@ -2,13 +2,13 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "zmqnotificationinterface.h" -#include "zmqpublishnotifier.h" +#include +#include -#include "version.h" -#include "main.h" -#include "streams.h" -#include "util.h" +#include +#include +#include +#include void zmqError(const char *str) { @@ -31,7 +31,7 @@ CZMQNotificationInterface::~CZMQNotificationInterface() CZMQNotificationInterface* CZMQNotificationInterface::CreateWithArguments(const std::map &args) { - CZMQNotificationInterface* notificationInterface = NULL; + CZMQNotificationInterface* notificationInterface = nullptr; std::map factories; std::list notifiers; @@ -62,7 +62,7 @@ CZMQNotificationInterface* CZMQNotificationInterface::CreateWithArguments(const if (!notificationInterface->Initialize()) { delete notificationInterface; - notificationInterface = NULL; + notificationInterface = nullptr; } } @@ -145,6 +145,7 @@ void CZMQNotificationInterface::SyncTransaction(const CTransaction& tx, const CB { for (std::list::iterator i = notifiers.begin(); i!=notifiers.end(); ) { + CZMQAbstractNotifier *notifier = *i; if (notifier->NotifyTransaction(tx)) { @@ -152,6 +153,7 @@ void CZMQNotificationInterface::SyncTransaction(const CTransaction& tx, const CB } else { + notifier->Shutdown(); i = notifiers.erase(i); } diff --git a/src/zmq/zmqnotificationinterface.h b/src/zmq/zmqnotificationinterface.h index 7b52e7775..f8f3e3ab8 100644 --- a/src/zmq/zmqnotificationinterface.h +++ b/src/zmq/zmqnotificationinterface.h @@ -5,7 +5,7 @@ #ifndef BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H #define BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H -#include "validationinterface.h" +#include #include #include diff --git a/src/zmq/zmqpublishnotifier.cpp b/src/zmq/zmqpublishnotifier.cpp index cdef17e08..7386e86f5 100644 --- a/src/zmq/zmqpublishnotifier.cpp +++ b/src/zmq/zmqpublishnotifier.cpp @@ -2,11 +2,11 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "chainparams.h" -#include "zmqpublishnotifier.h" -#include "main.h" -#include "util.h" -#include "rpc/server.h" +#include +#include +#include +#include +#include static std::multimap mapPublishNotifiers; diff --git a/src/zmq/zmqpublishnotifier.h b/src/zmq/zmqpublishnotifier.h index 751ded395..6ff35d676 100644 --- a/src/zmq/zmqpublishnotifier.h +++ b/src/zmq/zmqpublishnotifier.h @@ -5,14 +5,14 @@ #ifndef BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H #define BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H -#include "zmqabstractnotifier.h" +#include class CBlockIndex; class CZMQAbstractPublishNotifier : public CZMQAbstractNotifier { private: - uint32_t nSequence; //!< upcounting per message sequence number + uint32_t nSequence; //! upcounting per message sequence number public: