aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-01-02 10:25:05 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-01-02 10:24:45 +0100
commitfaaa4f2b6af4ce249fc4809a030240afa45b1a33 (patch)
tree3a2963ed2a2e2e3f5b34638f7913bc4e00010a1e /src/net_processing.cpp
parentae8f79713543d3db24a886cc27340b1570c2657d (diff)
downloadbitcoin-faaa4f2b6af4ce249fc4809a030240afa45b1a33.tar.xz
refactor: Remove nMyStartingHeight from CNode/Connman
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index c5ea2dc85f..dc9b051ddd 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -690,7 +690,7 @@ void PeerManager::PushNodeVersion(CNode& pnode, int64_t nTime)
// peer.
ServiceFlags nLocalNodeServices = pnode.GetLocalServices();
uint64_t nonce = pnode.GetLocalNonce();
- int nNodeStartingHeight = pnode.GetMyStartingHeight();
+ const int nNodeStartingHeight{m_best_height};
NodeId nodeid = pnode.GetId();
CAddress addr = pnode.addr;
@@ -1294,8 +1294,9 @@ void PeerManager::NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_
* Update our best height and announce any block hashes which weren't previously
* in ::ChainActive() to our peers.
*/
-void PeerManager::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) {
- m_connman.SetBestHeight(pindexNew->nHeight);
+void PeerManager::UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload)
+{
+ m_best_height = pindexNew->nHeight;
SetServiceFlagsIBDCache(!fInitialDownload);
// Don't relay inventory during initial block download.