mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-13 05:10:44 +02:00
[net processing] Remove unnecesary nNewHeight variable in UpdatedBlockTip()
This commit is contained in:
parent
8b57013473
commit
94d2cc35be
@ -1293,8 +1293,7 @@ void PeerManager::NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_
|
|||||||
* in ::ChainActive() to our peers.
|
* in ::ChainActive() to our peers.
|
||||||
*/
|
*/
|
||||||
void PeerManager::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) {
|
void PeerManager::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) {
|
||||||
const int nNewHeight = pindexNew->nHeight;
|
m_connman.SetBestHeight(pindexNew->nHeight);
|
||||||
m_connman.SetBestHeight(nNewHeight);
|
|
||||||
SetServiceFlagsIBDCache(!fInitialDownload);
|
SetServiceFlagsIBDCache(!fInitialDownload);
|
||||||
|
|
||||||
// Relay inventory, but don't relay old inventory during initial block download.
|
// 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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_connman.ForEachNode([nNewHeight, &vHashes](CNode* pnode) {
|
m_connman.ForEachNode([&vHashes](CNode* pnode) {
|
||||||
LOCK(pnode->cs_inventory);
|
LOCK(pnode->cs_inventory);
|
||||||
for (const uint256& hash : reverse_iterate(vHashes)) {
|
for (const uint256& hash : reverse_iterate(vHashes)) {
|
||||||
pnode->vBlockHashesToAnnounce.push_back(hash);
|
pnode->vBlockHashesToAnnounce.push_back(hash);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user