Skip to content

Commit 0ef7b40

Browse files
committed
[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`.
1 parent 3cf76c2 commit 0ef7b40

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
@@ -263,7 +263,8 @@ CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& loc
263263
{
264264
AssertLockHeld(cs_main);
265265

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

0 commit comments

Comments
 (0)