Skip to content

Commit 6df0c6c

Browse files
committed
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
2 parents 3fef58c + 0ef7b40 commit 6df0c6c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/validation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& loc
264264
{
265265
AssertLockHeld(cs_main);
266266

267-
// Find the first block the caller has in the main chain
267+
// Find the latest block common to locator and chain - we expect that
268+
// locator.vHave is sorted descending by height.
268269
for (const uint256& hash : locator.vHave) {
269270
CBlockIndex* pindex = LookupBlockIndex(hash);
270271
if (pindex) {

0 commit comments

Comments
 (0)