8 #include "validation.h" 30 int rc = zmq_msg_init_size(&
msg, size);
33 zmqError(
"Unable to initialize ZMQ msg");
37 void *buf = zmq_msg_data(&
msg);
40 data = va_arg(args,
const void*);
42 rc = zmq_msg_send(&
msg, sock,
data ? ZMQ_SNDMORE : 0);
55 size = va_arg(args,
size_t);
69 psocket = zmq_socket(pcontext, ZMQ_PUB);
106 typedef std::multimap<std::string, CZMQAbstractPublishNotifier*>::iterator iterator;
109 for (iterator it = iterpair.first; it != iterpair.second; ++it)
111 if (it->second==
this)
122 zmq_setsockopt(
psocket, ZMQ_LINGER, &linger,
sizeof(linger));
134 unsigned char msgseq[
sizeof(uint32_t)];
151 for (
unsigned int i = 0; i < 32; i++)
161 for (
unsigned int i = 0; i < 32; i++)
171 for (
unsigned int i = 0; i < 32; i++)
187 zmqError(
"Can't read block from disk");
static const char * MSG_HASHBLOCK
bool NotifyBlock(const CBlockIndex *pindex)
const Consensus::Params & GetConsensus() const
static std::multimap< std::string, CZMQAbstractPublishNotifier * > mapPublishNotifiers
bool NotifyTransactionLock(const CTransaction &transaction)
static void WriteLE32(unsigned char *ptr, uint32_t x)
static const char * MSG_HASHTX
static int LogPrint(const char *category, const char *format)
bool SendMessage(const char *command, const void *data, size_t size)
const_iterator begin() const
static const char * MSG_HASHTXLOCK
static int zmq_send_multipart(void *sock, const void *data, size_t size,...)
bool NotifyBlock(const CBlockIndex *pindex)
bool NotifyTransaction(const CTransaction &transaction)
static const char * MSG_RAWTX
static const char * MSG_RAWBLOCK
const CChainParams & Params()
void * memcpy(void *a, const void *b, size_t c)
static const int PROTOCOL_VERSION
const uint256 & GetHash() const
bool NotifyTransaction(const CTransaction &transaction)
uint256 GetBlockHash() const
static const char * MSG_RAWTXLOCK
std::string GetHex() const
bool NotifyTransactionLock(const CTransaction &transaction)
bool Initialize(void *pcontext)
bool ReadBlockFromDisk(CBlock &block, const CDiskBlockPos &pos, const Consensus::Params &consensusParams)
void zmqError(const char *str)