add checked block zmq nofitication type to publish verified blocks

This commit is contained in:
Jane Mercer
2019-04-17 06:54:21 -07:00
parent a9dfb37b0a
commit 222c0b226a
6 changed files with 50 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ static const char *MSG_HASHBLOCK = "hashblock";
static const char *MSG_HASHTX = "hashtx";
static const char *MSG_RAWBLOCK = "rawblock";
static const char *MSG_RAWTX = "rawtx";
static const char *MSG_CHECKEDBLOCK = "checkedblock";
// Internal function to send multipart message
static int zmq_send_multipart(void *sock, const void* data, size_t size, ...)
@@ -179,6 +180,19 @@ bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
return SendMessage(MSG_RAWBLOCK, &(*ss.begin()), ss.size());
}
bool CZMQPublishCheckedBlockNotifier::NotifyBlock(const CBlock& block)
{
LogPrint("zmq", "zmq: Publish checkedblock %s\n", block.GetHash().GetHex());
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
{
LOCK(cs_main);
ss << block;
}
return SendMessage(MSG_CHECKEDBLOCK, &(*ss.begin()), ss.size());
}
bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &transaction)
{
uint256 hash = transaction.GetHash();