@@ -312,7 +312,7 @@ class PeerManagerImpl final : public PeerManager
312
312
/* * Implement PeerManager */
313
313
void StartScheduledTasks (CScheduler& scheduler) override ;
314
314
void CheckForStaleTipAndEvictPeers () override ;
315
- bool FetchBlock (NodeId id, const uint256& hash, const CBlockIndex& index ) override ;
315
+ bool FetchBlock (NodeId id, const CBlockIndex& block_index ) override ;
316
316
bool GetNodeStateStats (NodeId nodeid, CNodeStateStats& stats) const override ;
317
317
bool IgnoresIncomingTxs () override { return m_ignore_incoming_txs; }
318
318
void SendPings () override ;
@@ -1428,7 +1428,7 @@ bool PeerManagerImpl::BlockRequestAllowed(const CBlockIndex* pindex)
1428
1428
(GetBlockProofEquivalentTime (*pindexBestHeader, *pindex, *pindexBestHeader, m_chainparams.GetConsensus ()) < STALE_RELAY_AGE_LIMIT);
1429
1429
}
1430
1430
1431
- bool PeerManagerImpl::FetchBlock (NodeId id, const uint256& hash, const CBlockIndex& index )
1431
+ bool PeerManagerImpl::FetchBlock (NodeId id, const CBlockIndex& block_index )
1432
1432
{
1433
1433
if (fImporting || fReindex ) return false ;
1434
1434
@@ -1440,9 +1440,10 @@ bool PeerManagerImpl::FetchBlock(NodeId id, const uint256& hash, const CBlockInd
1440
1440
if (!state->fHaveWitness ) return false ;
1441
1441
1442
1442
// Mark block as in-flight unless it already is
1443
- if (!BlockRequested (id, index )) return false ;
1443
+ if (!BlockRequested (id, block_index )) return false ;
1444
1444
1445
1445
// Construct message to request the block
1446
+ const uint256& hash{block_index.GetBlockHash ()};
1446
1447
std::vector<CInv> invs{CInv (MSG_BLOCK | MSG_WITNESS_FLAG, hash)};
1447
1448
1448
1449
// Send block request message to the peer
0 commit comments