Skip to content

Commit e3a0688

Browse files
author
MarcoFalke
committed
Merge #15659: [docs] fix findFork comment
c968780 [docs] fix comment: the return value of findFork is _not_ an ancestor when the specified block is on the active chain (r8921039) Pull request description: The return value of findFork is an ancestor of the specified block only when specified block is _not_ on the active chain. When it is on the active chain, the return value is the specified block itself, not an ancestor of it. ACKs for commit c96878: promag: utACK c968780, however comment could be shorter. ryanofsky: utACK c968780. Only change since last review is squash Tree-SHA512: bb05d734059898784c4a59b5b0344719eb4dfb2d49a0f7f705fcb2eb630702e66be81c01299185faf0c219fa9f9aa64cbdf6d5f91e0b3dce0ff420909a454a18
2 parents e82f6ad + c968780 commit e3a0688

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)