19 static std::multimap<std::string, CZMQAbstractPublishNotifier *>
35 int rc = zmq_msg_init_size(&msg, size);
37 zmqError(
"Unable to initialize ZMQ msg");
42 void *buf = zmq_msg_data(&msg);
43 memcpy(buf, data, size);
45 data = va_arg(args,
const void *);
47 rc = zmq_msg_send(&msg, sock, data ? ZMQ_SNDMORE : 0);
61 size = va_arg(args,
size_t);
71 std::multimap<std::string, CZMQAbstractPublishNotifier *>::iterator i =
75 psocket = zmq_socket(pcontext, ZMQ_PUB);
82 "zmq: Outbound message high water mark for %s at %s is %d\n",
85 int rc = zmq_setsockopt(
psocket, ZMQ_SNDHWM,
89 zmqError(
"Failed to set outbound message high water mark");
108 "zmq: Outbound message high water mark for %s at %s is %d\n",
127 typedef std::multimap<std::string, CZMQAbstractPublishNotifier *>::iterator
129 std::pair<iterator, iterator> iterpair =
132 for (iterator it = iterpair.first; it != iterpair.second; ++it) {
133 if (it->second ==
this) {
142 zmq_setsockopt(
psocket, ZMQ_LINGER, &linger,
sizeof(linger));
150 const void *data,
size_t size) {
154 uint8_t msgseq[
sizeof(uint32_t)];
157 msgseq, (
size_t)
sizeof(uint32_t),
nullptr);
172 for (
unsigned int i = 0; i < 32; i++) {
173 data[31 - i] = hash.
begin()[i];
183 for (
unsigned int i = 0; i < 32; i++) {
184 data[31 - i] = txid.
begin()[i];
199 config.GetChainParams().GetConsensus())) {
200 zmqError(
"Can't read block from disk");
static const char * MSG_HASHBLOCK
bool NotifyTransaction(const CTransaction &transaction) override
bool ReadBlockFromDisk(CBlock &block, const FlatFilePos &pos, const Consensus::Params ¶ms)
Functions for disk access for blocks.
uint32_t nSequence
upcounting per message sequence number
#define LogPrint(category,...)
static void WriteLE32(uint8_t *ptr, uint32_t x)
Double ended buffer combining vector and stream-like interfaces.
static const char * MSG_HASHTX
bool NotifyTransaction(const CTransaction &transaction) override
bool NotifyBlock(const CBlockIndex *pindex) override
BlockHash GetBlockHash() const
bool SendMessage(const char *command, const void *data, size_t size)
bool NotifyBlock(const CBlockIndex *pindex) override
RecursiveMutex cs_main
Global state.
static int zmq_send_multipart(void *sock, const void *data, size_t size,...)
const Config & GetConfig()
static const char * MSG_RAWTX
const_iterator begin() const
static const char * MSG_RAWBLOCK
A BlockHash is a unqiue identifier for a block.
The block chain is a tree shaped structure starting with the genesis block at the root...
int RPCSerializationFlags()
Retrieves any serialization flags requested in command line argument.
A TxId is the identifier of a transaction.
static const int PROTOCOL_VERSION
network protocol versioning
std::string GetHex() const
int outbound_message_high_water_mark
The basic transaction that is broadcasted on the network and contained in blocks. ...
void zmqError(const char *str)
static std::multimap< std::string, CZMQAbstractPublishNotifier * > mapPublishNotifiers
bool Initialize(void *pcontext) override