We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b953f32 commit 600b596Copy full SHA for 600b596
1 file changed
include/bitcoin/database/impl/query/network.ipp
@@ -104,12 +104,14 @@ CLASS::span CLASS::get_locator_span(const hashes& locator,
104
TEMPLATE
105
size_t CLASS::get_fork(const hashes& locator) const NOEXCEPT
106
{
107
- // Locator is presumed (by convention) to be in order by height.
+ // Locator is presumed (by convention) to be in reverse order by height.
108
for (const auto& hash: locator)
109
110
const auto link = to_header(hash);
111
- const auto height = get_height(link);
+ if (link.is_terminal())
112
+ continue;
113
114
+ const auto height = get_height(link);
115
table::height::record confirmed{};
116
if (store_.confirmed.get(height, confirmed) &&
117
confirmed.header_fk == link)
0 commit comments