From 0ef7b403d0a203ae2251ea0b9b926c7f41d80d1d Mon Sep 17 00:00:00 2001 From: James O'Beirne Date: Wed, 11 Apr 2018 14:14:45 -0400 Subject: [PATCH] [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`. --- src/validation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) {