aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-04-16 08:37:44 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-04-16 08:38:28 +0200
commit6df0c6cb4169701193868267526eff82be0c5a42 (patch)
tree6812a2cf6d78cc0cd977ece7f5eb4213b752c584 /src/validation.cpp
parent3fef58c82d7ac8aaafb68fcddf7f9003b61c5010 (diff)
parent0ef7b403d0a203ae2251ea0b9b926c7f41d80d1d (diff)
Merge #12951: [doc] Fix comment in FindForkInGlobalIndex
0ef7b40 [doc] Fix comment in FindForkInGlobalIndex (James O'Beirne) Pull request description: The comment erroneously implies that we're searching `chainActive` for the first block common to `locator`, but we're using the parameter `chain`. Tree-SHA512: 42ba0fb378597820bdf1eaff1e3e284097baa312e7dd8448421c8c71aa91c353ea6c840860afcb7725f392431f3134d4feb271b96ab7058a62f84f48e468e714
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index cbbc857fdc..958c187220 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -264,7 +264,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) {