refactor: Remove nMyStartingHeight from CNode/Connman

This commit is contained in:
MarcoFalke
2021-01-02 10:25:05 +01:00
parent ae8f797135
commit faaa4f2b6a
12 changed files with 33 additions and 55 deletions

View File

@ -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.