Skip to content

Commit

Permalink
Merge bitcoin#8995: Add missing cs_main lock to ::GETBLOCKTXN processing
Browse files Browse the repository at this point in the history
dfe7906 Add missing cs_main lock to ::GETBLOCKTXN processing (Matt Corallo)
  • Loading branch information
laanwj committed Oct 24, 2016
2 parents fd29348 + dfe7906 commit ced22d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5442,6 +5442,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
BlockTransactionsRequest req;
vRecv >> req;

LOCK(cs_main);

BlockMap::iterator it = mapBlockIndex.find(req.blockhash);
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);
Expand Down

0 comments on commit ced22d0

Please sign in to comment.