aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-09-06 13:58:27 +0200
committerMarcoFalke <falke.marco@gmail.com>2019-09-06 13:58:32 +0200
commitae3e3bd151f43dfa9e08bf592aafc6066bad258d (patch)
treef2fb839a859591d1fe103f375a16bb9d6bf62ad7 /src/validation.cpp
parent5e202382a987351a59d5cda98ea9f2aee99f61a5 (diff)
parent3109a1f948f3c8fd500defbdc4e59bfb2953c30b (diff)
Merge #16793: refactor: Avoid locking cs_main in ProcessNewBlockHeaders
3109a1f948f3c8fd500defbdc4e59bfb2953c30b refactor: Avoid locking cs_main in ProcessNewBlockHeaders (João Barbosa) Pull request description: Builds on #16774, this change avoids locking `cs_main` in `ProcessNewBlockHeaders` when the tip has changed - in this case the removed lock was necessary to just log a message. Top commit has no ACKs. Tree-SHA512: 31be6d319fa122804f72fa813cec5ed041dd7e4aef3c1921124a1f03016925c43cd4d9a272d80093e77fa7600e3506ef47b7bb821afcbffe01e6be9bceb6dc00
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index cbf8c90392..48b287890f 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -3398,7 +3398,6 @@ bool ProcessNewBlockHeaders(const std::vector<CBlockHeader>& headers, CValidatio
}
}
if (NotifyHeaderTip()) {
- LOCK(cs_main);
if (::ChainstateActive().IsInitialBlockDownload() && ppindex && *ppindex) {
LogPrintf("Synchronizing blockheaders, height: %d (~%.2f%%)\n", (*ppindex)->nHeight, 100.0/((*ppindex)->nHeight+(GetAdjustedTime() - (*ppindex)->GetBlockTime()) / Params().GetConsensus().nPowTargetSpacing) * (*ppindex)->nHeight);
}