|
|
|
@ -78,7 +78,7 @@ bool CZMQAbstractPublishNotifier::Initialize(void *pcontext)
@@ -78,7 +78,7 @@ bool CZMQAbstractPublishNotifier::Initialize(void *pcontext)
|
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
LogPrint("zmq", " Reuse socket for address %s\n", address); |
|
|
|
|
LogPrint("zmq", "zmq: Reusing socket for address %s\n", address); |
|
|
|
|
|
|
|
|
|
psocket = i->second->psocket; |
|
|
|
|
mapPublishNotifiers.insert(std::make_pair(address, this)); |
|
|
|
@ -120,7 +120,7 @@ void CZMQAbstractPublishNotifier::Shutdown()
@@ -120,7 +120,7 @@ void CZMQAbstractPublishNotifier::Shutdown()
|
|
|
|
|
bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex) |
|
|
|
|
{ |
|
|
|
|
uint256 hash = pindex->GetBlockHash(); |
|
|
|
|
LogPrint("zmq", "Publish hash block %s\n", hash.GetHex()); |
|
|
|
|
LogPrint("zmq", "zmq: Publish hashblock %s\n", hash.GetHex()); |
|
|
|
|
char data[32]; |
|
|
|
|
for (unsigned int i = 0; i < 32; i++) |
|
|
|
|
data[31 - i] = hash.begin()[i]; |
|
|
|
@ -131,7 +131,7 @@ bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
@@ -131,7 +131,7 @@ bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
|
|
|
|
|
bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &transaction) |
|
|
|
|
{ |
|
|
|
|
uint256 hash = transaction.GetHash(); |
|
|
|
|
LogPrint("zmq", "Publish hash transaction %s\n", hash.GetHex()); |
|
|
|
|
LogPrint("zmq", "zmq: Publish hashtx %s\n", hash.GetHex()); |
|
|
|
|
char data[32]; |
|
|
|
|
for (unsigned int i = 0; i < 32; i++) |
|
|
|
|
data[31 - i] = hash.begin()[i]; |
|
|
|
@ -141,7 +141,7 @@ bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &t
@@ -141,7 +141,7 @@ bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &t
|
|
|
|
|
|
|
|
|
|
bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex) |
|
|
|
|
{ |
|
|
|
|
LogPrint("zmq", "Publish raw block %s\n", pindex->GetBlockHash().GetHex()); |
|
|
|
|
LogPrint("zmq", "zmq: Publish rawblock %s\n", pindex->GetBlockHash().GetHex()); |
|
|
|
|
|
|
|
|
|
const Consensus::Params& consensusParams = Params().GetConsensus(); |
|
|
|
|
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); |
|
|
|
@ -164,7 +164,7 @@ bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
@@ -164,7 +164,7 @@ bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
|
|
|
|
|
bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &transaction) |
|
|
|
|
{ |
|
|
|
|
uint256 hash = transaction.GetHash(); |
|
|
|
|
LogPrint("zmq", "Publish raw transaction %s\n", hash.GetHex()); |
|
|
|
|
LogPrint("zmq", "zmq: Publish rawtx %s\n", hash.GetHex()); |
|
|
|
|
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); |
|
|
|
|
ss << transaction; |
|
|
|
|
int rc = zmq_send_multipart(psocket, "rawtx", 5, &(*ss.begin()), ss.size(), 0); |
|
|
|
|