diff options
author | Andrew Toth <andrewstoth@gmail.com> | 2022-12-06 15:06:03 -0500 |
---|---|---|
committer | Andrew Toth <andrewstoth@gmail.com> | 2022-12-06 15:07:04 -0500 |
commit | 7d253c943f44612431be894b198ffb49ff988fff (patch) | |
tree | c2f7ffebc26592f7d4f993c7788ead1991135ae2 /src/zmq | |
parent | c75e3d2772b00acc3850f72a8cb733a0345aa773 (diff) |
zmq: remove LOCK(cs_main) from NotifyBlock
Diffstat (limited to 'src/zmq')
-rw-r--r-- | src/zmq/zmqpublishnotifier.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/zmq/zmqpublishnotifier.cpp b/src/zmq/zmqpublishnotifier.cpp index eaf3455296..c785a929d3 100644 --- a/src/zmq/zmqpublishnotifier.cpp +++ b/src/zmq/zmqpublishnotifier.cpp @@ -248,18 +248,14 @@ bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex) const Consensus::Params& consensusParams = Params().GetConsensus(); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags()); - { - LOCK(cs_main); - CBlock block; - if(!ReadBlockFromDisk(block, pindex, consensusParams)) - { - zmqError("Can't read block from disk"); - return false; - } - - ss << block; + CBlock block; + if (!ReadBlockFromDisk(block, pindex, consensusParams)) { + zmqError("Can't read block from disk"); + return false; } + ss << block; + return SendZmqMessage(MSG_RAWBLOCK, &(*ss.begin()), ss.size()); } |