aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@gmail.com>2022-08-12 10:05:22 -0400
committerSuhas Daftuar <sdaftuar@gmail.com>2022-08-29 08:10:35 -0400
commit03712dddfbb9fe0dc7a2ead53c65106189f5c803 (patch)
tree26fa9f85ab867705e094f9b4a7826e7553021dfe /src/net_processing.cpp
parent150a5486db50ff77c91765392149000029c8a309 (diff)
downloadbitcoin-03712dddfbb9fe0dc7a2ead53c65106189f5c803.tar.xz
Expose HeadersSyncState::m_current_height in getpeerinfo()
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index ac19593b0f..f471e96b50 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1566,6 +1566,12 @@ bool PeerManagerImpl::GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) c
stats.m_addr_processed = peer->m_addr_processed.load();
stats.m_addr_rate_limited = peer->m_addr_rate_limited.load();
stats.m_addr_relay_enabled = peer->m_addr_relay_enabled.load();
+ {
+ LOCK(peer->m_headers_sync_mutex);
+ if (peer->m_headers_sync) {
+ stats.presync_height = peer->m_headers_sync->GetPresyncHeight();
+ }
+ }
return true;
}