diff --git a/include/bitcoin/node/protocols/protocol_header_in_70014.hpp b/include/bitcoin/node/protocols/protocol_header_in_70014.hpp index dbaea833..87349cfa 100644 --- a/include/bitcoin/node/protocols/protocol_header_in_70014.hpp +++ b/include/bitcoin/node/protocols/protocol_header_in_70014.hpp @@ -80,9 +80,11 @@ class BCN_API protocol_header_in_70014 virtual void do_organize_compact(const code& ec, const compact_block::cptr& message) NOEXCEPT; virtual void handle_submit_compact(const code& ec, size_t index, - const system::hash_digest& hash, size_t height) NOEXCEPT; + const system::hash_digest& hash, size_t height, size_t pooled, + size_t count) NOEXCEPT; virtual void do_submit_compact(const code& ec, - const system::hash_digest& hash, size_t height) NOEXCEPT; + const system::hash_digest& hash, size_t height, size_t pooled, + size_t count) NOEXCEPT; private: bool scan(fill& block) NOEXCEPT; diff --git a/src/chasers/chaser_validate_parallel.cpp b/src/chasers/chaser_validate_parallel.cpp index 110978f4..b712c856 100644 --- a/src/chasers/chaser_validate_parallel.cpp +++ b/src/chasers/chaser_validate_parallel.cpp @@ -84,8 +84,11 @@ void chaser_validate::validate_block(const header_link& link, if (!ec && current) { const auto elapsed = network::logger::now() - start; - fire(events::validate_usecs, - duration_cast(elapsed).count()); + const auto usecs = duration_cast(elapsed).count(); + fire(events::validate_usecs, usecs); + LOGN("Validated " << (pooled ? "pooled" : "full") << " block [" + << ctx.height << "] of (" << query.get_tx_count(link) + << ") txs in (" << usecs << ") usecs."); } --validate_backlog_; diff --git a/src/protocols/protocol_header_in_70014.cpp b/src/protocols/protocol_header_in_70014.cpp index 5a308aea..de29c552 100644 --- a/src/protocols/protocol_header_in_70014.cpp +++ b/src/protocols/protocol_header_in_70014.cpp @@ -425,8 +425,10 @@ void protocol_header_in_70014::identify() NOEXCEPT for (const auto position: block.unpooled) unpooled->push_back(block.txs.at(position)); + const auto count = block.txs.size(); submit_compact(unpooled, block.links, block.link, - BIND(handle_submit_compact, _1, _2, block.hash, block.height)); + BIND(handle_submit_compact, _1, _2, block.hash, block.height, + count - block.unpooled.size(), count)); fill_.reset(); } @@ -484,17 +486,19 @@ bool protocol_header_in_70014::is_malleated64(const fill& block) NOEXCEPT // not stranded void protocol_header_in_70014::handle_submit_compact(const code& ec, size_t, - const hash_digest& hash, size_t height) NOEXCEPT + const hash_digest& hash, size_t height, size_t pooled, + size_t count) NOEXCEPT { // Chaser may be stopped before protocol. if (stopped() || ec == network::error::service_stopped) return; - POST(do_submit_compact, ec, hash, height); + POST(do_submit_compact, ec, hash, height, pooled, count); } void protocol_header_in_70014::do_submit_compact(const code& ec, - const hash_digest& hash, size_t height) NOEXCEPT + const hash_digest& hash, size_t height, size_t pooled, + size_t count) NOEXCEPT { BC_ASSERT(stranded()); @@ -514,8 +518,9 @@ void protocol_header_in_70014::do_submit_compact(const code& ec, return; } - LOGP("Compact block [" << encode_hash(hash) << ":" << height - << "] from [" << opposite() << "]."); + LOGN("Compact block [" << encode_hash(hash) << ":" << height + << "] filled (" << pooled << "/" << count << ") from [" + << opposite() << "]."); } // Evidence.