Skip to content

Commit 9ef3875

Browse files
TheBlueMattlaanwj
authored andcommitted
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. Github-Pull: #8995 Rebased-From: dfe7906
1 parent 03422e5 commit 9ef3875

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
@@ -5388,6 +5388,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
53885388
BlockTransactionsRequest req;
53895389
vRecv >> req;
53905390

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

0 commit comments

Comments
 (0)