aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@gmail.com>2018-04-11 14:14:45 -0400
committerJames O'Beirne <james.obeirne@gmail.com>2018-04-11 15:56:37 -0400
commit0ef7b403d0a203ae2251ea0b9b926c7f41d80d1d (patch)
tree2a5abed7c426b7090ed60223cc865d889b36850d
parent3cf76c23fbfc8500fa494f8cef8068a67a1388c3 (diff)
downloadbitcoin-0ef7b403d0a203ae2251ea0b9b926c7f41d80d1d.tar.xz
[doc] Fix comment in FindForkInGlobalIndex
The comment erroneously implies that we're searching `chainActive` for the first block common to `locator`, but we're using the parameter `chain`.
-rw-r--r--src/validation.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 8066e6c7a8..72fa967c0e 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -263,7 +263,8 @@ CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& loc
{
AssertLockHeld(cs_main);
- // Find the first block the caller has in the main chain
+ // Find the latest block common to locator and chain - we expect that
+ // locator.vHave is sorted descending by height.
for (const uint256& hash : locator.vHave) {
CBlockIndex* pindex = LookupBlockIndex(hash);
if (pindex) {