diff --git a/include/bitcoin/node/chasers/chaser.hpp b/include/bitcoin/node/chasers/chaser.hpp index d63b6d90..60cf4f7e 100644 --- a/include/bitcoin/node/chasers/chaser.hpp +++ b/include/bitcoin/node/chasers/chaser.hpp @@ -131,13 +131,13 @@ class BCN_API chaser const node::settings& node_settings() const NOEXCEPT; /// Top candidate|confirmed is within configured span from current time. - bool is_current(bool confirmed) const NOEXCEPT; + bool is_current_chain(bool confirmed) const NOEXCEPT; /// Header timestamp is within configured span from current time. - bool is_current(uint32_t timestamp) const NOEXCEPT; + bool is_current_time(uint32_t timestamp) const NOEXCEPT; /// Header's timestamp is within configured span from current time. - bool is_current(const database::header_link& link) const NOEXCEPT; + bool is_current_header(const database::header_link& link) const NOEXCEPT; /// The confirmed chain is confirmed to maximum height or is current. bool is_recent() const NOEXCEPT; diff --git a/include/bitcoin/node/chasers/chaser_validate.hpp b/include/bitcoin/node/chasers/chaser_validate.hpp index bcca6cfd..369904c9 100644 --- a/include/bitcoin/node/chasers/chaser_validate.hpp +++ b/include/bitcoin/node/chasers/chaser_validate.hpp @@ -80,8 +80,8 @@ class BCN_API chaser_validate /// Batching. virtual code start_batch() NOEXCEPT; - virtual bool process_valids() NOEXCEPT; virtual void process_batch(bool residual) NOEXCEPT; + virtual bool process_valids(bool residual) NOEXCEPT; virtual void push_batch(const header_link& link, size_t height) NOEXCEPT; virtual bool process_invalids(const header_links& invalids) NOEXCEPT; virtual signatures get_capture(const header_link& link) NOEXCEPT; @@ -101,8 +101,7 @@ class BCN_API chaser_validate // Capture handlers. void do_log(const system::chain::script& missed) NOEXCEPT; - void do_fire(missed miss, size_t count, - const shared_lock_cptr& lock) NOEXCEPT; + void do_fire(missed miss, size_t count) NOEXCEPT; bool do_ecdsa(const system::hash_digest& digest, const system::ec_compressed& point, const system::ec_signature& sign, const header_link& link) NOEXCEPT; @@ -128,21 +127,18 @@ class BCN_API chaser_validate network::threadpool validation_threadpool_; // These are thread safe. - - // This prevents table updates during batch verify. + stopper stopping_{}; std::shared_mutex mutex_{}; - std::atomic ecdsa_{}; std::atomic schnorr_{}; std::atomic multisig_{}; std::atomic threshold_{}; - std::atomic missed_ecdsa_{}; std::atomic missed_schnorr_{}; std::atomic missed_multisig_{}; std::atomic missed_threshold_{}; - std::atomic backlog_{}; + network::asio::strand validation_strand_; const uint32_t subsidy_interval_; const uint64_t initial_subsidy_; diff --git a/include/bitcoin/node/error.hpp b/include/bitcoin/node/error.hpp index b1539218..93610678 100644 --- a/include/bitcoin/node/error.hpp +++ b/include/bitcoin/node/error.hpp @@ -115,9 +115,7 @@ enum error_t : uint8_t batch5, batch6, batch7, - batch8, - batch9, - batch10 + batch8 }; // No current need for error_code equivalence mapping. diff --git a/include/bitcoin/node/full_node.hpp b/include/bitcoin/node/full_node.hpp index 27a76558..5d9c9f50 100644 --- a/include/bitcoin/node/full_node.hpp +++ b/include/bitcoin/node/full_node.hpp @@ -133,10 +133,14 @@ class BCN_API full_node virtual const node::settings& node_settings() const NOEXCEPT; /// The candidate|confirmed chain is current. - virtual bool is_current(bool confirmed) const NOEXCEPT; + virtual bool is_current_chain(bool confirmed) const NOEXCEPT; /// The specified timestamp is current. - virtual bool is_current(uint32_t timestamp) const NOEXCEPT; + virtual bool is_current_time(uint32_t timestamp) const NOEXCEPT; + + /// Header's timestamp is within configured span from current time. + virtual bool is_current_header( + const database::header_link& link) const NOEXCEPT; /// The confirmed chain is confirmed to maximum height or is current. virtual bool is_recent() const NOEXCEPT; diff --git a/include/bitcoin/node/impl/chasers/chaser_organize.ipp b/include/bitcoin/node/impl/chasers/chaser_organize.ipp index 49675ffb..4bf58444 100644 --- a/include/bitcoin/node/impl/chasers/chaser_organize.ipp +++ b/include/bitcoin/node/impl/chasers/chaser_organize.ipp @@ -302,7 +302,7 @@ void CLASS::do_organize(typename Block::cptr block, // Delay so headers can get current before block download starts. // Checking currency before notify also avoids excessive work backlog. - if (is_block() || is_current(header.timestamp())) + if (is_block() || is_current_time(header.timestamp())) { if (!bumped_) { diff --git a/include/bitcoin/node/impl/sessions/session_peer.ipp b/include/bitcoin/node/impl/sessions/session_peer.ipp index c485ab48..b8cb802d 100644 --- a/include/bitcoin/node/impl/sessions/session_peer.ipp +++ b/include/bitcoin/node/impl/sessions/session_peer.ipp @@ -109,7 +109,7 @@ inline void CLASS::attach_protocols(const channel_ptr& channel) NOEXCEPT // Ready to relay transactions. const auto txs_in_out = relay && peer->is_negotiated(level::bip37) && - (!delay || is_current(true)); + (!delay || is_current_chain(true)); // Peer advertises chain (blocks in). if (peer->is_peer_service(service::node_network)) diff --git a/include/bitcoin/node/protocols/protocol.hpp b/include/bitcoin/node/protocols/protocol.hpp index f8f8d70a..aa02e192 100644 --- a/include/bitcoin/node/protocols/protocol.hpp +++ b/include/bitcoin/node/protocols/protocol.hpp @@ -66,7 +66,7 @@ class BCN_API protocol virtual const node::settings& node_settings() const NOEXCEPT; /// The candidate|confirmed chain is current. - virtual bool is_current(bool confirmed) const NOEXCEPT; + virtual bool is_current_chain(bool confirmed) const NOEXCEPT; /// Methods. /// ----------------------------------------------------------------------- diff --git a/include/bitcoin/node/sessions/session.hpp b/include/bitcoin/node/sessions/session.hpp index 2e99ced9..8c9332d3 100644 --- a/include/bitcoin/node/sessions/session.hpp +++ b/include/bitcoin/node/sessions/session.hpp @@ -104,7 +104,7 @@ class BCN_API session virtual const node::settings& node_settings() const NOEXCEPT; /// The candidate|confirmed chain is current. - virtual bool is_current(bool confirmed) const NOEXCEPT; + virtual bool is_current_chain(bool confirmed) const NOEXCEPT; /// The confirmed chain is confirmed to maximum height or is current. virtual bool is_recent() const NOEXCEPT; diff --git a/src/chasers/chaser.cpp b/src/chasers/chaser.cpp index 5fc64495..13423da6 100644 --- a/src/chasers/chaser.cpp +++ b/src/chasers/chaser.cpp @@ -18,7 +18,6 @@ */ #include -#include #include #include #include @@ -152,20 +151,20 @@ const node::settings& chaser::node_settings() const NOEXCEPT return node_.node_settings(); } -bool chaser::is_current(bool confirmed) const NOEXCEPT +bool chaser::is_current_chain(bool confirmed) const NOEXCEPT { - return node_.is_current(confirmed); + return node_.is_current_chain(confirmed); } -bool chaser::is_current(uint32_t timestamp) const NOEXCEPT +bool chaser::is_current_time(uint32_t timestamp) const NOEXCEPT { - return node_.is_current(timestamp); + return node_.is_current_time(timestamp); } // get_timestamp error results in false (ok). -bool chaser::is_current(const database::header_link& link) const NOEXCEPT +bool chaser::is_current_header(const database::header_link& link) const NOEXCEPT { - return node_.is_current(link); + return node_.is_current_header(link); } bool chaser::is_recent() const NOEXCEPT diff --git a/src/chasers/chaser_check.cpp b/src/chasers/chaser_check.cpp index 7fb8d739..64a20229 100644 --- a/src/chasers/chaser_check.cpp +++ b/src/chasers/chaser_check.cpp @@ -528,7 +528,7 @@ size_t chaser_check::set_unassociated() NOEXCEPT size_t chaser_check::get_inventory_size() const NOEXCEPT { - if (is_zero(connections_) || !is_current(false)) + if (is_zero(connections_) || !is_current_chain(false)) return zero; const auto& query = archive(); diff --git a/src/chasers/chaser_confirm.cpp b/src/chasers/chaser_confirm.cpp index c55091be..8fe3ac06 100644 --- a/src/chasers/chaser_confirm.cpp +++ b/src/chasers/chaser_confirm.cpp @@ -43,7 +43,7 @@ code chaser_confirm::start() NOEXCEPT const auto& query = archive(); set_position(query.get_fork()); - if (is_current(true)) + if (is_current_chain(true)) { LOGN("Node is current at startup block [" << position() << "]."); } @@ -423,7 +423,7 @@ void chaser_confirm::announce(const header_link& link, height_t) NOEXCEPT BC_ASSERT(stranded()); // Announce newly-organized blocks when confirmed chain is current. - if (is_current(true)) + if (is_current_chain(true)) notify(error::success, chase::block, link); } diff --git a/src/chasers/chaser_header.cpp b/src/chasers/chaser_header.cpp index 75b74033..aa351c0a 100644 --- a/src/chasers/chaser_header.cpp +++ b/src/chasers/chaser_header.cpp @@ -135,7 +135,7 @@ bool chaser_header::is_milestone(const chain_state& state) const NOEXCEPT bool chaser_header::is_current(const chain_state& state) const NOEXCEPT { - return chaser::is_current(state.timestamp()); + return chaser::is_current_time(state.timestamp()); } bool chaser_header::is_hard(const chain_state& state) const NOEXCEPT diff --git a/src/chasers/chaser_validate.cpp b/src/chasers/chaser_validate.cpp index dab881c4..6574d57f 100644 --- a/src/chasers/chaser_validate.cpp +++ b/src/chasers/chaser_validate.cpp @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -293,22 +294,28 @@ code chaser_validate::validate(bool& batched, bool& faulted, bool bypass, if ((ec = block.accept(ctx, subsidy_interval_, initial_subsidy_))) return ec; - // Initialize block capture. - // This call is blocked during signature batch evaluation. - const auto capture = get_capture(link); + // This critical section is mutually-exclusive with batch verification. + // ==================================================================== + { + const std::shared_lock lock{ mutex_ }; - // Sequentially connect block with signature capture (if enabled). - // There is not stop during connect, so a shutdown will wait on the - // completion (block consistency) of all signature captures. However - // the faulted state of a batch is not persisted (because disk full). - if ((ec = block.connect(ctx, capture))) - return ec; + // Initialize block capture. + const auto capture = get_capture(link); - // At least one signature batch was attempted (defer completion). - batched = capture.batched; + // Sequentially connect block with signature capture (if enabled). + // There is not stop during connect, so shutdown will wait on the + // completion (block consistency) of all signature captures. But + // the faulted state of batch is not persisted (because disk full). + if ((ec = block.connect(ctx, capture))) + return ec; - // Threshold batch commit failed, block otherwise passed (retry block). - faulted = capture.faulted; + // At least one signature batch was attempted (defer completion). + batched = capture.batched; + + // Threshold batch commit failed, block otherwise passed (retry). + faulted = capture.faulted; + // ================================================================ + } // Prevouts optimize confirmation. // Block will be retried if batch is faulted. @@ -372,9 +379,9 @@ void chaser_validate::complete_block(const code& ec, const header_link& link, // Not failed/invalid/batched/faulted, so block is complete (maybe valid). notify_block({}, height, link, bypass); - // Arriving here with batch enabled implies that the block is current and - // was not batched. Each such block triggers residual batch processing. - if (batch_enabled_) + // Batch enabled not bypassed implies that the block is current and was + // not batched. Each such block triggers residual batch processing. + if (!bypass && batch_enabled_) { POST(process_batch, true); } @@ -403,6 +410,9 @@ void chaser_validate::notify_block(const code& ec, size_t height, void chaser_validate::stopping(const code& ec) NOEXCEPT { + // Stop long-running batch validations. + stopping_.store(true); + // Stop threadpool keep-alive, all work must self-terminate to affect join. validation_threadpool_.stop(); chaser::stopping(ec); diff --git a/src/chasers/chaser_validate_batch.cpp b/src/chasers/chaser_validate_batch.cpp index 1850fbec..7cb50466 100644 --- a/src/chasers/chaser_validate_batch.cpp +++ b/src/chasers/chaser_validate_batch.cpp @@ -19,6 +19,7 @@ #include #include +#include #include namespace libbitcoin { @@ -37,13 +38,17 @@ BC_PUSH_WARNING(SMART_PTR_NOT_NEEDED) BC_PUSH_WARNING(NO_VALUE_OR_CONST_REF_SHARED_PTR) // TODO: ecdsa can be retained, as they don't fault, so set batched_ here. +// TODO: scnorr can be retained if each threshold carries total sig count. +// TODO: if so we can detect faulted (ignore) if full set is missing for block. // Cannot know if archived batch is faulted, despite being otherwise full, as // faulted is a non-persistent state. So we must purge batches at start. code chaser_validate::start_batch() NOEXCEPT { auto& query = archive(); - return (batch_enabled_ && (!query.purge_ecdsa_signatures() || - !query.purge_schnorr_signatures())) ? error::batch1 : error::success; + return (batch_enabled_ && + (!query.purge_ecdsa_signatures() || + !query.purge_schnorr_signatures())) ? + error::batch1 : error::success; } void chaser_validate::push_batch(const header_link& link, size_t height) NOEXCEPT @@ -64,7 +69,6 @@ void chaser_validate::process_batch(bool residual) NOEXCEPT BC_ASSERT(stranded()); // Test outside of lock to prevent reader contention for nearly all calls. - // Will retest inside the lock, as table updates are running concurrently. auto& query = archive(); if (!residual && (query.ecdsa_records() < batch_target_) && @@ -74,31 +78,38 @@ void chaser_validate::process_batch(bool residual) NOEXCEPT // Unique lock prevents batch table updates during evaluation, allowing the // tables to be fully purged upon completion, and ensuring that evaluation // does not operate over partial block records in the batch tables. - std::unique_lock lock(mutex_); + // ======================================================================== + const std::unique_lock lock{ mutex_ }; + + // Must retest inside the lock as table updates are running concurrently. + const auto ecdsa = query.ecdsa_records(); + const auto schnorr = query.schnorr_records(); + if (!residual && (ecdsa < batch_target_) && (schnorr < batch_target_)) + return; log_captures(); // set_block_unconfirmable(ecdsa) // ------------------------------------------------------------------------ - if (const auto records = query.ecdsa_records(); is_nonzero(records)) + if (is_nonzero(ecdsa)) { header_links invalids{}; const auto start = network::logger::now(); - if (!query.verify_ecdsa_signatures(invalids)) + if (!query.verify_ecdsa_signatures(stopping_, invalids)) { - fault(error::batch2); + // False return implies canceled (only). return; } const auto end = network::logger::now(); const auto elapsed = duration_cast(end - start).count(); fire(events::ecdsa_secs, elapsed); - LOGN(log_rate("Batch verify rate ecdsa.... ", records, elapsed)); + LOGN(log_rate("Batch verify rate ecdsa.... ", ecdsa, elapsed)); if (!process_invalids(invalids) || !query.purge_ecdsa_signatures()) { - fault(error::batch3); + fault(error::batch2); return; } } @@ -106,24 +117,24 @@ void chaser_validate::process_batch(bool residual) NOEXCEPT // set_block_unconfirmable(schnorr) // ------------------------------------------------------------------------ - if (const auto records = query.schnorr_records(); is_nonzero(records)) + if (is_nonzero(schnorr)) { header_links invalids{}; const auto start = network::logger::now(); - if (!query.verify_schnorr_signatures(invalids)) + if (!query.verify_schnorr_signatures(stopping_, invalids)) { - fault(error::batch4); + // False return implies canceled (only). return; } const auto end = network::logger::now(); const auto elapsed = duration_cast(end - start).count(); fire(events::schnorr_secs, elapsed); - LOGN(log_rate("Batch verify rate schnorr.. ", records, elapsed)); + LOGN(log_rate("Batch verify rate schnorr.. ", schnorr, elapsed)); if (!process_invalids(invalids) || !query.purge_schnorr_signatures()) { - fault(error::batch5); + fault(error::batch3); return; } } @@ -131,11 +142,12 @@ void chaser_validate::process_batch(bool residual) NOEXCEPT // set_block_valid(batched_ excluding ecdsa/schnorr failures) // ------------------------------------------------------------------------ - if (!process_valids()) + if (!process_valids(residual)) { - fault(error::batch6); + fault(error::batch4); return; } + // ======================================================================== } // Invalids might not be included in batched, as link push is a race. @@ -170,7 +182,7 @@ bool chaser_validate::process_invalids(const header_links& invalids) NOEXCEPT // Set all batched blocks that aren't invalid to valid. // May be ancestors of invalid, in which case they are also unconfirmable. -bool chaser_validate::process_valids() NOEXCEPT +bool chaser_validate::process_valids(bool residual) NOEXCEPT { BC_ASSERT(stranded()); @@ -192,7 +204,7 @@ bool chaser_validate::process_valids() NOEXCEPT } batched_.clear(); - if (is_current(true)) + if (residual) batched_.shrink_to_fit(); return true; @@ -200,19 +212,15 @@ bool chaser_validate::process_valids() NOEXCEPT signatures chaser_validate::get_capture(const header_link& link) NOEXCEPT { - if (!batch_enabled_ || is_current(link)) + if (!batch_enabled_ || is_current_header(link)) return { false }; - // This call is blocked during signature batch evaluation and all - // outstanding captures block signature batch evaluation until complete. - const auto lock = emplace_shared(mutex_); - const auto sequence = to_shared(); return signatures { .enabled = true, .log = BIND_THIS(do_log, _1), - .fire = BIND_THIS(do_fire, _1, _2, lock), + .fire = BIND_THIS(do_fire, _1, _2), .ecdsa = BIND_THIS(do_ecdsa, _1, _2, _3, link), .schnorr = BIND_THIS(do_schnorr, _1, _2, _3, link), .multisig = BIND_THIS(do_multisig, _1, _2, _3, link, sequence), @@ -230,9 +238,7 @@ void chaser_validate::do_log(const script& ) NOEXCEPT //// << missed.to_string(flags::all_rules)); } -// Captures shared lock on batch verification. -void chaser_validate::do_fire(missed miss, size_t count, - const shared_lock_cptr&) NOEXCEPT +void chaser_validate::do_fire(missed miss, size_t count) NOEXCEPT { switch (miss) { @@ -255,7 +261,7 @@ bool chaser_validate::do_ecdsa(const hash_digest& digest, { ++ecdsa_; const auto set = archive().set_signature(digest, point, sign, link); - if (!set) fault(error::batch7); + if (!set) fault(error::batch5); return set; } @@ -265,7 +271,7 @@ bool chaser_validate::do_schnorr(const hash_digest& digest, { ++schnorr_; const auto set = archive().set_signature(digest, point, sign, link); - if (!set) fault(error::batch8); + if (!set) fault(error::batch6); return set; } @@ -278,7 +284,7 @@ bool chaser_validate::do_multisig(const hash_digest& , multisig_ += points.size(); ////const auto set = archive().set_signatures(digest, points, signs, //// (*sequence)++, link); - ////if (!set) fault(error::batch9); + ////if (!set) fault(error::batch7); ////return set; return true; } @@ -288,7 +294,7 @@ bool chaser_validate::do_threshold(const threshold_group& group, { threshold_ += group.entries.size(); ////const auto set = archive().set_signatures(group, (*sequence)++, link); - ////if (!set) fault(error::batch10); + ////if (!set) fault(error::batch8); ////return set; return true; } diff --git a/src/error.cpp b/src/error.cpp index d7e8a165..b58a5c96 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -105,9 +105,7 @@ DEFINE_ERROR_T_MESSAGE_MAP(error) { batch5, "batch5" }, { batch6, "batch6" }, { batch7, "batch7" }, - { batch8, "batch8" }, - { batch9, "batch9" }, - { batch10, "batch10" } + { batch8, "batch8" } }; DEFINE_ERROR_T_CATEGORY(error, "node", "node code") diff --git a/src/full_node.cpp b/src/full_node.cpp index b610de7a..792a9f0a 100644 --- a/src/full_node.cpp +++ b/src/full_node.cpp @@ -398,15 +398,15 @@ const node::settings& full_node::node_settings() const NOEXCEPT return config_.node; } -bool full_node::is_current(bool confirmed) const NOEXCEPT +bool full_node::is_current_chain(bool confirmed) const NOEXCEPT { if (is_zero(config_.node.currency_window_minutes)) return true; - return is_current(query_.get_top_timestamp(confirmed)); + return is_current_time(query_.get_top_timestamp(confirmed)); } -bool full_node::is_current(uint32_t timestamp) const NOEXCEPT +bool full_node::is_current_time(uint32_t timestamp) const NOEXCEPT { if (is_zero(config_.node.currency_window_minutes)) return true; @@ -416,16 +416,26 @@ bool full_node::is_current(uint32_t timestamp) const NOEXCEPT return time >= current; } -bool full_node::is_recent() const NOEXCEPT +// get_timestamp error results in false (ok). +bool full_node::is_current_header(const header_link& link) const NOEXCEPT { - const auto top = query_.get_top_confirmed(); - if (!is_zero(config_.node.maximum_height) && - top >= config_.node.maximum_height) + if (is_zero(config_.node.currency_window_minutes)) return true; uint32_t timestamp{}; - const auto link = query_.to_confirmed(top); - return is_current(query_.get_timestamp(timestamp, link)); + if (!query_.get_timestamp(timestamp, link)) + return false; + + return is_current_time(timestamp); +} + +bool full_node::is_recent() const NOEXCEPT +{ + if (is_nonzero(config_.node.maximum_height) && + (query_.get_top_confirmed() >= config_.node.maximum_height)) + return true; + + return is_current_time(true); } // Methods. diff --git a/src/protocols/protocol.cpp b/src/protocols/protocol.cpp index c0d68a2a..76d72cb0 100644 --- a/src/protocols/protocol.cpp +++ b/src/protocols/protocol.cpp @@ -61,9 +61,9 @@ const node::settings& protocol::node_settings() const NOEXCEPT return session_->node_settings(); } -bool protocol::is_current(bool confirmed) const NOEXCEPT +bool protocol::is_current_chain(bool confirmed) const NOEXCEPT { - return session_->is_current(confirmed); + return session_->is_current_chain(confirmed); } // Methods. diff --git a/src/protocols/protocol_block_in_31800.cpp b/src/protocols/protocol_block_in_31800.cpp index c6709af5..c9cf8031 100644 --- a/src/protocols/protocol_block_in_31800.cpp +++ b/src/protocols/protocol_block_in_31800.cpp @@ -69,7 +69,7 @@ void protocol_block_in_31800::subscribed(const code& ec, object_key) NOEXCEPT // Start performance timing and download cycles if candidates are current. // This prevents a startup delay in which the node waits on a header. - if (is_current(false)) + if (is_current_chain(false)) { start_performance(); get_hashes(BIND(handle_get_hashes, _1, _2, _3)); diff --git a/src/protocols/protocol_block_out_106.cpp b/src/protocols/protocol_block_out_106.cpp index 6c97fd08..c59fca93 100644 --- a/src/protocols/protocol_block_out_106.cpp +++ b/src/protocols/protocol_block_out_106.cpp @@ -261,7 +261,7 @@ protocol_block_out_106::inventory protocol_block_out_106::create_inventory( const get_blocks& locator) const NOEXCEPT { // Empty response implies complete (success). - if (!is_current(true)) + if (!is_current_chain(true)) return {}; return inventory::factory diff --git a/src/protocols/protocol_header_in_31800.cpp b/src/protocols/protocol_header_in_31800.cpp index 6abb96da..89f28a86 100644 --- a/src/protocols/protocol_header_in_31800.cpp +++ b/src/protocols/protocol_header_in_31800.cpp @@ -134,7 +134,7 @@ void protocol_header_in_31800::complete() NOEXCEPT BC_ASSERT(stranded()); // There are no header announcements at 31800, so translate from inv. - if (!subscribed && is_current(true)) + if (!subscribed && is_current_chain(true)) { subscribed = true; SUBSCRIBE_CHANNEL(inventory, handle_receive_inventory, _1, _2); diff --git a/src/protocols/protocol_header_out_31800.cpp b/src/protocols/protocol_header_out_31800.cpp index e0505b93..9529f8b9 100644 --- a/src/protocols/protocol_header_out_31800.cpp +++ b/src/protocols/protocol_header_out_31800.cpp @@ -73,7 +73,7 @@ network::messages::peer::headers protocol_header_out_31800::create_headers( const get_headers& locator) const NOEXCEPT { // Empty response implies complete (success). - if (!is_current(true)) + if (!is_current_chain(true)) return {}; return diff --git a/src/sessions/session.cpp b/src/sessions/session.cpp index 91eb4a22..10ed367c 100644 --- a/src/sessions/session.cpp +++ b/src/sessions/session.cpp @@ -150,9 +150,9 @@ const node::settings& session::node_settings() const NOEXCEPT return node_.node_settings(); } -bool session::is_current(bool confirmed) const NOEXCEPT +bool session::is_current_chain(bool confirmed) const NOEXCEPT { - return node_.is_current(confirmed); + return node_.is_current_chain(confirmed); } bool session::is_recent() const NOEXCEPT diff --git a/test/error.cpp b/test/error.cpp index 813aa4f1..3636a5ef 100644 --- a/test/error.cpp +++ b/test/error.cpp @@ -308,6 +308,6 @@ BOOST_AUTO_TEST_CASE(error_t__code__batch1__true_expected_message) BOOST_REQUIRE_EQUAL(ec.message(), "batch1"); } -// TODO: batch2-batch9 +// TODO: batch2-batch8 BOOST_AUTO_TEST_SUITE_END()