0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00

zmq: remove LOCK(cs_main) from NotifyBlock

This commit is contained in:
Andrew Toth 2022-12-06 15:06:03 -05:00
parent c75e3d2772
commit 7d253c943f

View file

@ -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());
}