Skip to content

Commit c968780

Browse files
committed
[docs] fix comment: the return value of findFork is _not_ an ancestor when the specified block is on the active chain
update with suggested comment text from the reviewers
1 parent 7b13c64 commit c968780

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/interfaces/chain.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ class Chain
120120
//! nullopt if no block in the range is pruned. Range is inclusive.
121121
virtual Optional<int> findPruned(int start_height = 0, Optional<int> stop_height = nullopt) = 0;
122122

123-
//! Return height of the highest block on the chain that is an ancestor
124-
//! of the specified block, or nullopt if no common ancestor is found.
123+
//! Return height of the specified block if it is on the chain, otherwise
124+
//! return the height of the highest block on chain that's an ancestor
125+
//! of the specified block, or nullopt if there is no common ancestor.
125126
//! Also return the height of the specified block as an optional output
126127
//! parameter (to avoid the cost of a second hash lookup in case this
127128
//! information is desired).
@@ -135,9 +136,9 @@ class Chain
135136
//! Get locator for the current chain tip.
136137
virtual CBlockLocator getTipLocator() = 0;
137138

138-
//! Return height of the latest block common to locator and chain, which
139-
//! is guaranteed to be an ancestor of the block used to create the
140-
//! locator.
139+
//! Return height of the highest block on chain in common with the locator,
140+
//! which will either be the original block used to create the locator,
141+
//! or one of its ancestors.
141142
virtual Optional<int> findLocatorFork(const CBlockLocator& locator) = 0;
142143

143144
//! Check if transaction will be final given chain height current time.

0 commit comments

Comments
 (0)