Skip to content

Commit 96b1b62

Browse files
committed
add BLOCK
1 parent c9bd983 commit 96b1b62

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/net_processing.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -4589,6 +4589,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
45894589

45904590
if (msg_type == NetMsgType::BLOCK)
45914591
{
4592+
auto event = g_event_logger->time_event("BLOCK");
4593+
45924594
// Ignore block received while importing
45934595
if (m_chainman.m_blockman.LoadingBlocks()) {
45944596
LogDebug(BCLog::NET, "Unexpected block message received from peer %d\n", pfrom.GetId());
@@ -4598,6 +4600,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
45984600
std::shared_ptr<CBlock> pblock = std::make_shared<CBlock>();
45994601
vRecv >> TX_WITH_WITNESS(*pblock);
46004602

4603+
event.add_metadata("blockhash="+pblock->GetHash().ToString());
4604+
46014605
LogDebug(BCLog::NET, "received block %s peer=%d\n", pblock->GetHash().ToString(), pfrom.GetId());
46024606

46034607
const CBlockIndex* prev_block{WITH_LOCK(m_chainman.GetMutex(), return m_chainman.m_blockman.LookupBlockIndex(pblock->hashPrevBlock))};

src/validation.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2449,7 +2449,7 @@ bool Chainstate::ConnectBlock(const CBlock& block, BlockValidationState& state,
24492449
AssertLockHeld(cs_main);
24502450
assert(pindex);
24512451

2452-
auto event = g_event_logger->time_event("CoB");
2452+
auto event = g_event_logger->time_event("ConnectBlock");
24532453

24542454
uint256 block_hash{block.GetHash()};
24552455
assert(*pindex->phashBlock == block_hash);

0 commit comments

Comments
 (0)