zmq: remove LOCK(cs_main) from NotifyBlock

This commit is contained in:
Andrew Toth committed 2022-12-06 15:07:04 -05:00
1 parent c75e3d2772
commit 7d253c943f
1 file changed
+6 -10
+6 -10
View File
@@ -248,18 +248,14 @@ bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
const Consensus::Params& consensusParams = Params().GetConsensus(); const Consensus::Params& consensusParams = Params().GetConsensus();
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags()); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
{ CBlock block;
LOCK(cs_main); if (!ReadBlockFromDisk(block, pindex, consensusParams)) {
CBlock block; zmqError("Can't read block from disk");
if(!ReadBlockFromDisk(block, pindex, consensusParams)) return false;
{
zmqError("Can't read block from disk");
return false;
}
ss << block;
} }
ss << block;
return SendZmqMessage(MSG_RAWBLOCK, &(*ss.begin()), ss.size()); return SendZmqMessage(MSG_RAWBLOCK, &(*ss.begin()), ss.size());
} }