aboutsummaryrefslogtreecommitdiff
path: root/src/zmq/zmqpublishnotifier.cpp
diff options
context:
space:
mode:
authorAndrew Toth <andrewstoth@gmail.com>2024-03-12 12:46:46 -0400
committerAndrew Toth <andrewstoth@gmail.com>2024-03-12 12:46:46 -0400
commit38265cc14e7d646bf27882329d374d42167eb49f (patch)
tree45d8c2c7f8743a1b2fe21f9bb9b57da026b2a477 /src/zmq/zmqpublishnotifier.cpp
parentda338aada7943c392013c36c542af621fbc6edd1 (diff)
zmq: read raw block with ReadRawBlockFromDisk
Diffstat (limited to 'src/zmq/zmqpublishnotifier.cpp')
-rw-r--r--src/zmq/zmqpublishnotifier.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/zmq/zmqpublishnotifier.cpp b/src/zmq/zmqpublishnotifier.cpp
index 0f20706364..608870c489 100644
--- a/src/zmq/zmqpublishnotifier.cpp
+++ b/src/zmq/zmqpublishnotifier.cpp
@@ -243,16 +243,13 @@ bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
{
LogPrint(BCLog::ZMQ, "Publish rawblock %s to %s\n", pindex->GetBlockHash().GetHex(), this->address);
- DataStream ss;
- CBlock block;
+ std::vector<uint8_t> block{};
if (!m_get_block_by_index(block, *pindex)) {
zmqError("Can't read block from disk");
return false;
}
- ss << TX_WITH_WITNESS(block);
-
- return SendZmqMessage(MSG_RAWBLOCK, &(*ss.begin()), ss.size());
+ return SendZmqMessage(MSG_RAWBLOCK, block.data(), block.size());
}
bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &transaction)