mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-06 14:19:59 -05:00
zmq: remove LOCK(cs_main) from NotifyBlock
This commit is contained in:
parent
c75e3d2772
commit
7d253c943f
1 changed files with 6 additions and 10 deletions
|
@ -248,17 +248,13 @@ 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());
|
||||||
{
|
|
||||||
LOCK(cs_main);
|
|
||||||
CBlock block;
|
CBlock block;
|
||||||
if(!ReadBlockFromDisk(block, pindex, consensusParams))
|
if (!ReadBlockFromDisk(block, pindex, consensusParams)) {
|
||||||
{
|
|
||||||
zmqError("Can't read block from disk");
|
zmqError("Can't read block from disk");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ss << block;
|
ss << block;
|
||||||
}
|
|
||||||
|
|
||||||
return SendZmqMessage(MSG_RAWBLOCK, &(*ss.begin()), ss.size());
|
return SendZmqMessage(MSG_RAWBLOCK, &(*ss.begin()), ss.size());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue