@@ -1490,13 +1490,13 @@ void PeerManagerImpl::RelayTransaction(const uint256& txid, const uint256& wtxid
1490
1490
* address. So within 24h we will likely relay a given address once. This is to
1491
1491
* prevent a peer from unjustly giving their address better propagation by sending
1492
1492
* it to us repeatedly.
1493
- * @param[in] originator The peer that sent us the address. We don't want to relay it back.
1493
+ * @param[in] originator The id of the peer that sent us the address. We don't want to relay it back.
1494
1494
* @param[in] addr Address to relay.
1495
1495
* @param[in] fReachable Whether the address' network is reachable. We relay unreachable
1496
1496
* addresses less.
1497
1497
* @param[in] connman Connection manager to choose nodes to relay to.
1498
1498
*/
1499
- static void RelayAddress (const CNode& originator,
1499
+ static void RelayAddress (NodeId originator,
1500
1500
const CAddress& addr,
1501
1501
bool fReachable ,
1502
1502
const CConnman& connman)
@@ -1516,8 +1516,8 @@ static void RelayAddress(const CNode& originator,
1516
1516
std::array<std::pair<uint64_t , CNode*>,2 > best{{{0 , nullptr }, {0 , nullptr }}};
1517
1517
assert (nRelayNodes <= best.size ());
1518
1518
1519
- auto sortfunc = [&best, &hasher, nRelayNodes, & originator, &addr](CNode* pnode) {
1520
- if (pnode->RelayAddrsWithConn () && pnode != & originator && pnode->IsAddrCompatible (addr)) {
1519
+ auto sortfunc = [&best, &hasher, nRelayNodes, originator, &addr](CNode* pnode) {
1520
+ if (pnode->RelayAddrsWithConn () && pnode-> GetId () != originator && pnode->IsAddrCompatible (addr)) {
1521
1521
uint64_t hashKey = CSipHasher (hasher).Write (pnode->GetId ()).Finalize ();
1522
1522
for (unsigned int i = 0 ; i < nRelayNodes; i++) {
1523
1523
if (hashKey > best[i].first ) {
@@ -2683,7 +2683,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
2683
2683
if (addr.nTime > nSince && !pfrom.fGetAddr && vAddr.size () <= 10 && addr.IsRoutable ())
2684
2684
{
2685
2685
// Relay to a limited number of other nodes
2686
- RelayAddress (pfrom, addr, fReachable , m_connman);
2686
+ RelayAddress (pfrom. GetId () , addr, fReachable , m_connman);
2687
2687
}
2688
2688
// Do not store addresses outside our network
2689
2689
if (fReachable )
0 commit comments