@@ -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
- std::optional<std::string> FetchBlock (NodeId id , const CBlockIndex& block_index) override ;
315
+ std::optional<std::string> FetchBlock (NodeId peer_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,38 +1428,38 @@ bool PeerManagerImpl::BlockRequestAllowed(const CBlockIndex* pindex)
1428
1428
(GetBlockProofEquivalentTime (*pindexBestHeader, *pindex, *pindexBestHeader, m_chainparams.GetConsensus ()) < STALE_RELAY_AGE_LIMIT);
1429
1429
}
1430
1430
1431
- std::optional<std::string> PeerManagerImpl::FetchBlock (NodeId id , const CBlockIndex& block_index)
1431
+ std::optional<std::string> PeerManagerImpl::FetchBlock (NodeId peer_id , const CBlockIndex& block_index)
1432
1432
{
1433
1433
if (fImporting ) return " Importing..." ;
1434
1434
if (fReindex ) return " Reindexing..." ;
1435
1435
1436
1436
LOCK (cs_main);
1437
1437
// Ensure this peer exists and hasn't been disconnected
1438
- CNodeState* state = State (id );
1438
+ CNodeState* state = State (peer_id );
1439
1439
if (state == nullptr ) return " Peer does not exist" ;
1440
1440
// Ignore pre-segwit peers
1441
1441
if (!state->fHaveWitness ) return " Pre-SegWit peer" ;
1442
1442
1443
1443
// Mark block as in-flight unless it already is (for this peer).
1444
1444
// If a block was already in-flight for a different peer, its BLOCKTXN
1445
1445
// response will be dropped.
1446
- if (!BlockRequested (id , block_index)) return " Already requested from this peer" ;
1446
+ if (!BlockRequested (peer_id , block_index)) return " Already requested from this peer" ;
1447
1447
1448
1448
// Construct message to request the block
1449
1449
const uint256& hash{block_index.GetBlockHash ()};
1450
1450
std::vector<CInv> invs{CInv (MSG_BLOCK | MSG_WITNESS_FLAG, hash)};
1451
1451
1452
1452
// Send block request message to the peer
1453
- bool success = m_connman.ForNode (id , [this , &invs](CNode* node) {
1453
+ bool success = m_connman.ForNode (peer_id , [this , &invs](CNode* node) {
1454
1454
const CNetMsgMaker msgMaker (node->GetCommonVersion ());
1455
1455
this ->m_connman .PushMessage (node, msgMaker.Make (NetMsgType::GETDATA, invs));
1456
1456
return true ;
1457
1457
});
1458
1458
1459
- if (!success) return " Node not fully connected" ;
1459
+ if (!success) return " Peer not fully connected" ;
1460
1460
1461
1461
LogPrint (BCLog::NET, " Requesting block %s from peer=%d\n " ,
1462
- hash.ToString (), id );
1462
+ hash.ToString (), peer_id );
1463
1463
return std::nullopt;
1464
1464
}
1465
1465
0 commit comments