8#include <chainparams.h>
27static std::multimap<std::string, CZMQAbstractPublishNotifier *>
46 zmqError(
"Unable to initialize ZMQ msg");
54 data =
va_arg(args,
const void *);
70 size =
va_arg(args,
size_t);
80 std::multimap<std::string, CZMQAbstractPublishNotifier *>::iterator i =
91 "zmq: Outbound message high water mark for %s at %s is %d\n",
98 zmqError(
"Failed to set outbound message high water mark");
107 zmqError(
"Failed to set SO_KEEPALIVE");
126 "zmq: Outbound message high water mark for %s at %s is %d\n",
145 typedef std::multimap<std::string, CZMQAbstractPublishNotifier *>::iterator
147 std::pair<iterator, iterator>
iterpair =
151 if (it->second ==
this) {
192 for (
unsigned int i = 0; i < 32; i++) {
193 data[31 - i] = hash.
begin()[i];
204 for (
unsigned int i = 0; i < 32; i++) {
205 data[31 - i] = txid.
begin()[i];
217 zmqError(
"Can't read block from disk");
243 for (
unsigned int i = 0; i <
sizeof(
BlockHash); i++) {
247 data[
sizeof(data) - 1] =
'C';
257 for (
unsigned int i = 0; i <
sizeof(
BlockHash); i++) {
261 data[
sizeof(data) - 1] =
'D';
271 for (
unsigned int i = 0; i <
sizeof(
TxId); i++) {
272 data[
sizeof(
TxId) - 1 - i] = txid.
begin()[i];
275 data[
sizeof(
TxId)] =
'A';
286 for (
unsigned int i = 0; i <
sizeof(
TxId); i++) {
287 data[
sizeof(
TxId) - 1 - i] = txid.
begin()[i];
290 data[
sizeof(
TxId)] =
'R';
The block chain is a tree shaped structure starting with the genesis block at the root,...
BlockHash GetBlockHash() const
Double ended buffer combining vector and stream-like interfaces.
int outbound_message_high_water_mark
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
bool NotifyBlock(const CBlockIndex *pindex) override
const std::function< bool(CBlock &, 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
std::string GetHex() const
static void WriteLE32(uint8_t *ptr, uint32_t x)
static void WriteLE64(uint8_t *ptr, uint64_t x)
#define LogPrint(category,...)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
int RPCSerializationFlags()
Retrieves any serialization flags requested in command line argument.
A BlockHash is a unqiue identifier for a block.
A TxId is the identifier of a transaction.
static const int PROTOCOL_VERSION
network protocol versioning
static const char * MSG_HASHBLOCK
static const char * MSG_SEQUENCE
static std::multimap< std::string, CZMQAbstractPublishNotifier * > mapPublishNotifiers
static const char * MSG_RAWBLOCK
static const char * MSG_RAWTX
static int zmq_send_multipart(void *sock, const void *data, size_t size,...)
static const char * MSG_HASHTX
void zmqError(const char *str)