Skip to content

Commit dfe7906

Browse files
committed
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.
1 parent 3cf496d commit dfe7906

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5442,6 +5442,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
54425442
BlockTransactionsRequest req;
54435443
vRecv >> req;
54445444

5445+
LOCK(cs_main);
5446+
54455447
BlockMap::iterator it = mapBlockIndex.find(req.blockhash);
54465448
if (it == mapBlockIndex.end() || !(it->second->nStatus & BLOCK_HAVE_DATA)) {
54475449
LogPrintf("Peer %d sent us a getblocktxn for a block we don't have", pfrom->id);

0 commit comments

Comments
 (0)