Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2015-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or http://www.opensource.org/licenses/mit-license.php.5#ifndef BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H6#define BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H8#include <zmq/zmqabstractnotifier.h>10#include <cstddef>11#include <cstdint>12#include <functional>13#include <utility>14#include <vector>16class CBlockIndex;18class CZMQAbstractPublishNotifier : public CZMQAbstractNotifier19{20private:21uint32_t nSequence {0U}; //!< upcounting per message sequence number23public:25/* send zmq multipart message26parts:27* command28* data29* message sequence number30*/31bool SendZmqMessage(const char *command, const void* data, size_t size);33bool Initialize(void *pcontext) override;34void Shutdown() override;35};37class CZMQPublishHashBlockNotifier : public CZMQAbstractPublishNotifier38{39public:40bool NotifyBlock(const CBlockIndex *pindex) override;41};43class CZMQPublishHashTransactionNotifier : public CZMQAbstractPublishNotifier44{45public:46bool NotifyTransaction(const CTransaction &transaction) override;47};49class CZMQPublishRawBlockNotifier : public CZMQAbstractPublishNotifier50{51private:52const std::function<bool(std::vector<std::byte>&, const CBlockIndex&)> m_get_block_by_index;54public:55CZMQPublishRawBlockNotifier(std::function<bool(std::vector<std::byte>&, const CBlockIndex&)> get_block_by_index)56: m_get_block_by_index{std::move(get_block_by_index)} {}57bool NotifyBlock(const CBlockIndex *pindex) override;58};60class CZMQPublishRawTransactionNotifier : public CZMQAbstractPublishNotifier61{62public:63bool NotifyTransaction(const CTransaction &transaction) override;64};66class CZMQPublishSequenceNotifier : public CZMQAbstractPublishNotifier67{68public:69bool NotifyBlockConnect(const CBlockIndex *pindex) override;70bool NotifyBlockDisconnect(const CBlockIndex *pindex) override;71bool NotifyTransactionAcceptance(const CTransaction &transaction, uint64_t mempool_sequence) override;72bool NotifyTransactionRemoval(const CTransaction &transaction, uint64_t mempool_sequence) override;73};75#endif // BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.