Skip to content

Commit 7d253c9

Browse files
committed
zmq: remove LOCK(cs_main) from NotifyBlock
1 parent c75e3d2 commit 7d253c9

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/zmq/zmqpublishnotifier.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -248,18 +248,14 @@ bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
248248

249249
const Consensus::Params& consensusParams = Params().GetConsensus();
250250
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
251-
{
252-
LOCK(cs_main);
253-
CBlock block;
254-
if(!ReadBlockFromDisk(block, pindex, consensusParams))
255-
{
256-
zmqError("Can't read block from disk");
257-
return false;
258-
}
259-
260-
ss << block;
251+
CBlock block;
252+
if (!ReadBlockFromDisk(block, pindex, consensusParams)) {
253+
zmqError("Can't read block from disk");
254+
return false;
261255
}
262256

257+
ss << block;
258+
263259
return SendZmqMessage(MSG_RAWBLOCK, &(*ss.begin()), ss.size());
264260
}
265261

0 commit comments

Comments
 (0)