@@ -312,7 +312,7 @@ class PeerManagerImpl final : public PeerManager
312312 /* * Implement PeerManager */
313313 void StartScheduledTasks (CScheduler& scheduler) override ;
314314 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 ;
316316 bool GetNodeStateStats (NodeId nodeid, CNodeStateStats& stats) const override ;
317317 bool IgnoresIncomingTxs () override { return m_ignore_incoming_txs; }
318318 void SendPings () override ;
@@ -1428,38 +1428,38 @@ bool PeerManagerImpl::BlockRequestAllowed(const CBlockIndex* pindex)
14281428 (GetBlockProofEquivalentTime (*pindexBestHeader, *pindex, *pindexBestHeader, m_chainparams.GetConsensus ()) < STALE_RELAY_AGE_LIMIT);
14291429}
14301430
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)
14321432{
14331433 if (fImporting ) return " Importing..." ;
14341434 if (fReindex ) return " Reindexing..." ;
14351435
14361436 LOCK (cs_main);
14371437 // Ensure this peer exists and hasn't been disconnected
1438- CNodeState* state = State (id );
1438+ CNodeState* state = State (peer_id );
14391439 if (state == nullptr ) return " Peer does not exist" ;
14401440 // Ignore pre-segwit peers
14411441 if (!state->fHaveWitness ) return " Pre-SegWit peer" ;
14421442
14431443 // Mark block as in-flight unless it already is (for this peer).
14441444 // If a block was already in-flight for a different peer, its BLOCKTXN
14451445 // 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" ;
14471447
14481448 // Construct message to request the block
14491449 const uint256& hash{block_index.GetBlockHash ()};
14501450 std::vector<CInv> invs{CInv (MSG_BLOCK | MSG_WITNESS_FLAG, hash)};
14511451
14521452 // 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) {
14541454 const CNetMsgMaker msgMaker (node->GetCommonVersion ());
14551455 this ->m_connman .PushMessage (node, msgMaker.Make (NetMsgType::GETDATA, invs));
14561456 return true ;
14571457 });
14581458
1459- if (!success) return " Node not fully connected" ;
1459+ if (!success) return " Peer not fully connected" ;
14601460
14611461 LogPrint (BCLog::NET, " Requesting block %s from peer=%d\n " ,
1462- hash.ToString (), id );
1462+ hash.ToString (), peer_id );
14631463 return std::nullopt ;
14641464}
14651465
0 commit comments