Skip to content

Commit 94d2cc3

Browse files
committed
[net processing] Remove unnecesary nNewHeight variable in UpdatedBlockTip()
1 parent 8b57013 commit 94d2cc3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/net_processing.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,8 +1293,7 @@ void PeerManager::NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_
12931293
* in ::ChainActive() to our peers.
12941294
*/
12951295
void PeerManager::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) {
1296-
const int nNewHeight = pindexNew->nHeight;
1297-
m_connman.SetBestHeight(nNewHeight);
1296+
m_connman.SetBestHeight(pindexNew->nHeight);
12981297
SetServiceFlagsIBDCache(!fInitialDownload);
12991298

13001299
// Relay inventory, but don't relay old inventory during initial block download.
@@ -1311,7 +1310,7 @@ void PeerManager::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockInde
13111310
break;
13121311
}
13131312
}
1314-
m_connman.ForEachNode([nNewHeight, &vHashes](CNode* pnode) {
1313+
m_connman.ForEachNode([&vHashes](CNode* pnode) {
13151314
LOCK(pnode->cs_inventory);
13161315
for (const uint256& hash : reverse_iterate(vHashes)) {
13171316
pnode->vBlockHashesToAnnounce.push_back(hash);

0 commit comments

Comments
 (0)