aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2016-10-21 12:15:19 -0400
committerMatt Corallo <git@bluematt.me>2016-10-21 12:15:19 -0400
commitdfe79060a62c8de098e75d527d97b99c3b10de50 (patch)
treee9532bb597d69a9607d981edeb22ae702a7a0d1b /src
parent3cf496d102d2cc4a5ff7da653f65917b2d5db029 (diff)
downloadbitcoin-dfe79060a62c8de098e75d527d97b99c3b10de50.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index df4f5e3959..37daa08da9 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);