mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-12 18:44:59 +01:00
add m_last_block_announcement to CNodeStateStats
Copy its value from CNodeState. Unused until the next commit.
This commit is contained in:
parent
50ed54854a
commit
7e86088685
2 changed files with 3 additions and 1 deletions
|
@ -1679,6 +1679,7 @@ bool PeerManagerImpl::GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) c
|
|||
if (queue.pindex)
|
||||
stats.vHeightInFlight.push_back(queue.pindex->nHeight);
|
||||
}
|
||||
stats.m_last_block_announcement = state->m_last_block_announcement;
|
||||
}
|
||||
|
||||
PeerRef peer = GetPeerRef(nodeid);
|
||||
|
@ -5156,7 +5157,7 @@ void PeerManagerImpl::EvictExtraOutboundPeers(std::chrono::seconds now)
|
|||
CNodeState &state = *State(pnode->GetId());
|
||||
if (now - pnode->m_connected > MINIMUM_CONNECT_TIME && state.vBlocksInFlight.empty()) {
|
||||
LogDebug(BCLog::NET, "disconnecting extra outbound peer=%d (last block announcement received at time %d)\n",
|
||||
pnode->GetId(), (*oldest_block_announcement).time_since_epoch().count());
|
||||
pnode->GetId(), TicksSinceEpoch<std::chrono::seconds>(*oldest_block_announcement));
|
||||
pnode->fDisconnect = true;
|
||||
return true;
|
||||
} else {
|
||||
|
|
|
@ -50,6 +50,7 @@ struct CNodeStateStats {
|
|||
ServiceFlags their_services;
|
||||
int64_t presync_height{-1};
|
||||
std::chrono::seconds time_offset{0};
|
||||
NodeSeconds m_last_block_announcement;
|
||||
};
|
||||
|
||||
struct PeerManagerInfo {
|
||||
|
|
Loading…
Add table
Reference in a new issue