Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
zmqpublishnotifier.h
Go to the documentation of this file.
1// Copyright (c) 2015-present The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H
6#define BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H
7
9
10#include <cstddef>
11#include <cstdint>
12#include <functional>
13#include <utility>
14#include <vector>
15
16class CBlockIndex;
17
19{
20private:
22
23public:
24
25 /* send zmq multipart message
26 parts:
27 * command
28 * data
29 * message sequence number
30 */
31 bool SendZmqMessage(const char *command, const void* data, size_t size);
32
33 bool Initialize(void *pcontext) override;
34 void Shutdown() override;
35};
36
38{
39public:
40 bool NotifyBlock(const CBlockIndex *pindex) override;
41};
42
48
50{
51private:
52 const std::function<bool(std::vector<std::byte>&, const CBlockIndex&)> m_get_block_by_index;
53
54public:
55 CZMQPublishRawBlockNotifier(std::function<bool(std::vector<std::byte>&, const CBlockIndex&)> get_block_by_index)
57 bool NotifyBlock(const CBlockIndex *pindex) override;
58};
59
65
74
75#endif // BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H
const auto command
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition chain.h:94
The basic transaction that is broadcasted on the network and contained in blocks.
bool SendZmqMessage(const char *command, const void *data, size_t size)
uint32_t nSequence
upcounting per message sequence number
bool Initialize(void *pcontext) override
bool NotifyBlock(const CBlockIndex *pindex) override
bool NotifyTransaction(const CTransaction &transaction) override
CZMQPublishRawBlockNotifier(std::function< bool(std::vector< std::byte > &, const CBlockIndex &)> get_block_by_index)
bool NotifyBlock(const CBlockIndex *pindex) override
const std::function< bool(std::vector< std::byte > &, const CBlockIndex &) m_get_block_by_index)
bool NotifyTransaction(const CTransaction &transaction) override
bool NotifyTransactionAcceptance(const CTransaction &transaction, uint64_t mempool_sequence) override
bool NotifyTransactionRemoval(const CTransaction &transaction, uint64_t mempool_sequence) override
bool NotifyBlockConnect(const CBlockIndex *pindex) override
bool NotifyBlockDisconnect(const CBlockIndex *pindex) override
Definition common.h:29
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition time.h:73