diff --git a/include/bitcoin/node/error.hpp b/include/bitcoin/node/error.hpp index 01046684..82e099f6 100644 --- a/include/bitcoin/node/error.hpp +++ b/include/bitcoin/node/error.hpp @@ -123,6 +123,7 @@ enum error_t : uint8_t transaction6, transaction7, transaction8, + transaction9, estimates_initialize, estimates_push1, estimates_push2, diff --git a/src/chasers/chaser_check.cpp b/src/chasers/chaser_check.cpp index 1db711be..90e70779 100644 --- a/src/chasers/chaser_check.cpp +++ b/src/chasers/chaser_check.cpp @@ -531,10 +531,10 @@ size_t chaser_check::set_unassociated() NOEXCEPT const auto timeout = node_settings().compact_timeout(); if (!is_zero(timeout.count()) && is_current_chain(false)) { - const auto top = query.get_top_candidate(); - const auto link = query.to_candidate(top); + size_t top{}; + const auto link = query.to_top_candidate(); if (link != expired_ && query.is_compact(link) && - !query.is_associated(link)) + !query.is_associated(link) && query.get_height(top, link)) { stop = std::min(stop, sub1(top)); if (link != deferred_) diff --git a/src/chasers/chaser_transaction.cpp b/src/chasers/chaser_transaction.cpp index 5f2c3317..bf2675ce 100644 --- a/src/chasers/chaser_transaction.cpp +++ b/src/chasers/chaser_transaction.cpp @@ -113,9 +113,16 @@ void chaser_transaction::do_bump() NOEXCEPT auto& query = archive(); if (network_settings().enable_relay) { - const auto top = query.get_top_confirmed(); + size_t height{}; + const auto top = query.to_top_confirmed(); + if (!query.get_height(height, top)) + { + fault(error::transaction9); + return; + } + const auto state = query.get_confirmed_chain_state(system_settings(), - query.to_confirmed(top), top); + top, height); if (!state) { @@ -135,7 +142,7 @@ void chaser_transaction::do_bump() NOEXCEPT // A complete map reaches genesis, and keeps up with the top until latched. // Rows of a block archived before the latch may precede mapped starts. - const auto top = query.to_confirmed(query.get_top_confirmed()); + const auto top = query.to_top_confirmed(); const auto unmapped = query.get_scan_start(top).is_terminal(); if (query.get_scan_start(query.to_confirmed(zero)).is_terminal()) start_scan(true); @@ -153,7 +160,7 @@ void chaser_transaction::start_scan(bool remap) NOEXCEPT const auto& query = archive(); const auto bound = query.is_pooling() ? query.get_scan_frontier() : max_size_t; - const auto top = query.to_confirmed(query.get_top_confirmed()); + const auto top = query.to_top_confirmed(); boost::asio::post(scan_threadpool_.service(), BIND(do_scan, top, bound, remap)); } diff --git a/src/error.cpp b/src/error.cpp index 0fffa1da..48b0a508 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -113,6 +113,7 @@ DEFINE_ERROR_T_MESSAGE_MAP(error) { transaction6, "transaction6" }, { transaction7, "transaction7" }, { transaction8, "transaction8" }, + { transaction9, "transaction9" }, { estimates_initialize, "estimates_initialize" }, { estimates_push1, "estimates_push1" }, { estimates_push2, "estimates_push2" },