@@ -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);
1075
+ void LogBlockHeader (const CBlockIndex& index, const CNode& peer );
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);
2987
+ LogBlockHeader (*pindexLast, pfrom );
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) {
3417
+ void PeerManagerImpl::LogBlockHeader (const CBlockIndex& index, const CNode& peer ) {
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,9 +3426,11 @@ void PeerManagerImpl::LogBlockHeader(const CBlockIndex& index) {
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" ,
3429
+ " Saw new header hash=%s height=%d peer=%d%s " ,
3430
3430
index.GetBlockHash ().ToString (),
3431
- index.nHeight
3431
+ index.nHeight ,
3432
+ peer.GetId (),
3433
+ peer.LogIP (fLogIPs )
3432
3434
);
3433
3435
if (m_chainman.IsInitialBlockDownload ()) {
3434
3436
LogDebug (BCLog::VALIDATION, " %s" , msg);
0 commit comments