Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions include/bitcoin/node/protocols/protocol_header_in_70014.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions src/chasers/chaser_validate_parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<microseconds>(elapsed).count());
const auto usecs = duration_cast<microseconds>(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_;
Expand Down
17 changes: 11 additions & 6 deletions src/protocols/protocol_header_in_70014.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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());

Expand All @@ -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.
Expand Down
Loading