diff --git a/src/main.cpp b/src/main.cpp index df4f5e3959e0e..37daa08da9a26 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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);