Skip to content

Commit e66f89a

Browse files
authored
Merge pull request #736 from evoskuil/master
Test network queries.
2 parents b953f32 + 1cdd691 commit e66f89a

2 files changed

Lines changed: 684 additions & 5 deletions

File tree

include/bitcoin/database/impl/query/network.ipp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,14 @@ CLASS::span CLASS::get_locator_span(const hashes& locator,
104104
TEMPLATE
105105
size_t CLASS::get_fork(const hashes& locator) const NOEXCEPT
106106
{
107-
// Locator is presumed (by convention) to be in order by height.
107+
// Locator is presumed (by convention) to be in reverse order by height.
108108
for (const auto& hash: locator)
109109
{
110110
const auto link = to_header(hash);
111-
const auto height = get_height(link);
111+
if (link.is_terminal())
112+
continue;
112113

114+
const auto height = get_height(link);
113115
table::height::record confirmed{};
114116
if (store_.confirmed.get(height, confirmed) &&
115117
confirmed.header_fk == link)

0 commit comments

Comments
 (0)