@@ -1072,7 +1072,7 @@ class PeerManagerImpl final : public PeerManager
1072
1072
void AddAddressKnown (Peer& peer, const CAddress& addr) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex);
1073
1073
void PushAddress (Peer& peer, const CAddress& addr) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex);
1074
1074
1075
- void LogBlockHeader (const CBlockIndex& index, const CNode& peer);
1075
+ void LogBlockHeader (const CBlockIndex& index, const CNode& peer, bool via_compact_block );
1076
1076
};
1077
1077
1078
1078
const CNodeState* PeerManagerImpl::State (NodeId pnode) const
@@ -2984,7 +2984,7 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, Peer& peer,
2984
2984
assert (pindexLast);
2985
2985
2986
2986
if (processed && received_new_header) {
2987
- LogBlockHeader (*pindexLast, pfrom);
2987
+ LogBlockHeader (*pindexLast, pfrom, /* via_compact_block= */ false );
2988
2988
}
2989
2989
2990
2990
// Consider fetching more headers if we are not using our headers-sync mechanism.
@@ -3414,7 +3414,7 @@ void PeerManagerImpl::ProcessCompactBlockTxns(CNode& pfrom, Peer& peer, const Bl
3414
3414
return ;
3415
3415
}
3416
3416
3417
- void PeerManagerImpl::LogBlockHeader (const CBlockIndex& index, const CNode& peer) {
3417
+ void PeerManagerImpl::LogBlockHeader (const CBlockIndex& index, const CNode& peer, bool via_compact_block ) {
3418
3418
// To prevent log spam, this function should only be called after it was determined that a
3419
3419
// header is both new and valid.
3420
3420
//
@@ -3426,7 +3426,8 @@ void PeerManagerImpl::LogBlockHeader(const CBlockIndex& index, const CNode& peer
3426
3426
// Having this log by default when not in IBD ensures broad availability of
3427
3427
// this data in case investigation is merited.
3428
3428
const auto msg = strprintf (
3429
- " Saw new header hash=%s height=%d peer=%d%s" ,
3429
+ " Saw new %sheader hash=%s height=%d peer=%d%s" ,
3430
+ via_compact_block ? " cmpctblock " : " " ,
3430
3431
index.GetBlockHash ().ToString (),
3431
3432
index.nHeight ,
3432
3433
peer.GetId (),
@@ -4387,9 +4388,10 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4387
4388
}
4388
4389
}
4389
4390
4391
+ // If AcceptBlockHeader returned true, it set pindex
4392
+ Assert (pindex);
4390
4393
if (received_new_header) {
4391
- LogInfo (" Saw new cmpctblock header hash=%s peer=%d\n " ,
4392
- blockhash.ToString (), pfrom.GetId ());
4394
+ LogBlockHeader (*pindex, pfrom, /* via_compact_block=*/ true );
4393
4395
}
4394
4396
4395
4397
bool fProcessBLOCKTXN = false ;
@@ -4405,8 +4407,6 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4405
4407
4406
4408
{
4407
4409
LOCK (cs_main);
4408
- // If AcceptBlockHeader returned true, it set pindex
4409
- assert (pindex);
4410
4410
UpdateBlockAvailability (pfrom.GetId (), pindex->GetBlockHash ());
4411
4411
4412
4412
CNodeState *nodestate = State (pfrom.GetId ());
0 commit comments