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_ZMQNOTIFICATIONINTERFACE_H6#define BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H8#include <primitives/transaction.h>9#include <validationinterface.h>11#include <cstddef>12#include <cstdint>13#include <functional>14#include <list>15#include <memory>16#include <vector>18class CBlockIndex;19class CZMQAbstractNotifier;21class CZMQNotificationInterface final : public CValidationInterface22{23public:24~CZMQNotificationInterface();26std::list<const CZMQAbstractNotifier*> GetActiveNotifiers() const;28static std::unique_ptr<CZMQNotificationInterface> Create(std::function<bool(std::vector<std::byte>&, const CBlockIndex&)> get_block_by_index);30protected:31bool Initialize();32void Shutdown();34// CValidationInterface35void TransactionAddedToMempool(const NewMempoolTransactionInfo& tx, uint64_t mempool_sequence) override;36void TransactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason, uint64_t mempool_sequence) override;37void BlockConnected(const kernel::ChainstateRole& role, const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected) override;38void BlockDisconnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexDisconnected) override;39void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;41private:42CZMQNotificationInterface();44void* pcontext{nullptr};45std::list<std::unique_ptr<CZMQAbstractNotifier>> notifiers;46};48extern std::unique_ptr<CZMQNotificationInterface> g_zmq_notification_interface;50#endif // BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_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.