diff options
author | Matt Corallo <git@bluematt.me> | 2016-10-21 12:15:19 -0400 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-10-27 14:47:22 +0200 |
commit | 9ef38758a69abfb6166099bf8dea1d69e258ae00 (patch) | |
tree | d6cf9f583c3e9d7661182ba7a0fd6783d86cc9e6 /src/main.cpp | |
parent | 03422e564b552c1d3c16ae854f8471f7cb39e25d (diff) |
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: dfe79060a62c8de098e75d527d97b99c3b10de50
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 61d0aaf0b9..84f4607dba 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5388,6 +5388,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); |