Browse Source

Add missing cs_main lock to ::GETBLOCKTXN processing

Note that this is not a major issue as, in order for the missing
lock to cause issues, you have to receive a GETBLOCKTXN message
while reindexing, adding a block header via RPC, etc, which results
in either a table rehash or an insert into the bucket which you are
currently looking at.
0.14
Matt Corallo 8 years ago
parent
commit
dfe79060a6
  1. 2
      src/main.cpp

2
src/main.cpp

@ -5442,6 +5442,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
BlockTransactionsRequest req; BlockTransactionsRequest req;
vRecv >> req; vRecv >> req;
LOCK(cs_main);
BlockMap::iterator it = mapBlockIndex.find(req.blockhash); BlockMap::iterator it = mapBlockIndex.find(req.blockhash);
if (it == mapBlockIndex.end() || !(it->second->nStatus & BLOCK_HAVE_DATA)) { if (it == mapBlockIndex.end() || !(it->second->nStatus & BLOCK_HAVE_DATA)) {
LogPrintf("Peer %d sent us a getblocktxn for a block we don't have", pfrom->id); LogPrintf("Peer %d sent us a getblocktxn for a block we don't have", pfrom->id);

Loading…
Cancel
Save