diff --git a/src/zmq/CMakeLists.txt b/src/zmq/CMakeLists.txt --- a/src/zmq/CMakeLists.txt +++ b/src/zmq/CMakeLists.txt @@ -7,6 +7,7 @@ zmqnotificationinterface.cpp zmqpublishnotifier.cpp zmqrpc.cpp + zmqutil.cpp ) find_package(ZeroMQ 4.1.5 REQUIRED) diff --git a/src/zmq/zmqabstractnotifier.h b/src/zmq/zmqabstractnotifier.h --- a/src/zmq/zmqabstractnotifier.h +++ b/src/zmq/zmqabstractnotifier.h @@ -5,11 +5,11 @@ #ifndef BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H #define BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H -#include - #include +#include class CBlockIndex; +class CTransaction; class CZMQAbstractNotifier; using CZMQNotifierFactory = std::unique_ptr (*)(); diff --git a/src/zmq/zmqabstractnotifier.cpp b/src/zmq/zmqabstractnotifier.cpp --- a/src/zmq/zmqabstractnotifier.cpp +++ b/src/zmq/zmqabstractnotifier.cpp @@ -4,6 +4,8 @@ #include +#include + const int CZMQAbstractNotifier::DEFAULT_ZMQ_SNDHWM; CZMQAbstractNotifier::~CZMQAbstractNotifier() { diff --git a/src/zmq/zmqconfig.h b/src/zmq/zmqconfig.h deleted file mode 100644 --- a/src/zmq/zmqconfig.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2014 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_ZMQ_ZMQCONFIG_H -#define BITCOIN_ZMQ_ZMQCONFIG_H - -#if defined(HAVE_CONFIG_H) -#include -#endif - -#if ENABLE_ZMQ -#include -#endif - -#include - -void zmqError(const char *str); - -#endif // BITCOIN_ZMQ_ZMQCONFIG_H diff --git a/src/zmq/zmqnotificationinterface.cpp b/src/zmq/zmqnotificationinterface.cpp --- a/src/zmq/zmqnotificationinterface.cpp +++ b/src/zmq/zmqnotificationinterface.cpp @@ -4,15 +4,13 @@ #include #include +#include + +#include #include #include -void zmqError(const char *str) { - LogPrint(BCLog::ZMQ, "zmq: Error: %s, errno=%s\n", str, - zmq_strerror(errno)); -} - CZMQNotificationInterface::CZMQNotificationInterface() : pcontext(nullptr) {} CZMQNotificationInterface::~CZMQNotificationInterface() { diff --git a/src/zmq/zmqpublishnotifier.cpp b/src/zmq/zmqpublishnotifier.cpp --- a/src/zmq/zmqpublishnotifier.cpp +++ b/src/zmq/zmqpublishnotifier.cpp @@ -13,6 +13,8 @@ #include #include #include +#include + #include #include diff --git a/src/zmq/zmqutil.h b/src/zmq/zmqutil.h new file mode 100644 --- /dev/null +++ b/src/zmq/zmqutil.h @@ -0,0 +1,10 @@ +// Copyright (c) 2014-2018 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_ZMQ_ZMQUTIL_H +#define BITCOIN_ZMQ_ZMQUTIL_H + +void zmqError(const char *str); + +#endif // BITCOIN_ZMQ_ZMQUTIL_H diff --git a/src/zmq/zmqutil.cpp b/src/zmq/zmqutil.cpp new file mode 100644 --- /dev/null +++ b/src/zmq/zmqutil.cpp @@ -0,0 +1,14 @@ +// Copyright (c) 2014-2018 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include + +#include + +#include + +void zmqError(const char *str) { + LogPrint(BCLog::ZMQ, "zmq: Error: %s, errno=%s\n", str, + zmq_strerror(errno)); +}