aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-12-11 10:35:32 +0000
committerJohn Newbery <john@johnnewbery.com>2020-12-11 10:35:32 +0000
commit94d2cc35be98d3b20db88b2a3745322e5b0aa9d4 (patch)
tree6517e8aff8981a1790b3aa0a79962e82cbb872a9 /src/net_processing.cpp
parent8b57013473c44fc87c9f1c4611224a89187c289a (diff)
[net processing] Remove unnecesary nNewHeight variable in UpdatedBlockTip()
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 6e9d8119ab..acacb7c592 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1293,8 +1293,7 @@ void PeerManager::NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_
* in ::ChainActive() to our peers.
*/
void PeerManager::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) {
- const int nNewHeight = pindexNew->nHeight;
- m_connman.SetBestHeight(nNewHeight);
+ m_connman.SetBestHeight(pindexNew->nHeight);
SetServiceFlagsIBDCache(!fInitialDownload);
// Relay inventory, but don't relay old inventory during initial block download.
@@ -1311,7 +1310,7 @@ void PeerManager::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockInde
break;
}
}
- m_connman.ForEachNode([nNewHeight, &vHashes](CNode* pnode) {
+ m_connman.ForEachNode([&vHashes](CNode* pnode) {
LOCK(pnode->cs_inventory);
for (const uint256& hash : reverse_iterate(vHashes)) {
pnode->vBlockHashesToAnnounce.push_back(hash);