@@ -153,7 +153,7 @@ uint16_t GetListenPort()
153
153
}
154
154
155
155
// find 'best' local address for a particular peer
156
- bool GetLocal (CService& addr, const CNetAddr *paddrPeer )
156
+ bool GetLocal (CService& addr, const CNode& peer )
157
157
{
158
158
if (!fListen )
159
159
return false ;
@@ -165,7 +165,7 @@ bool GetLocal(CService& addr, const CNetAddr *paddrPeer)
165
165
for (const auto & entry : mapLocalHost)
166
166
{
167
167
int nScore = entry.second .nScore ;
168
- int nReachability = entry.first .GetReachabilityFrom (paddrPeer );
168
+ int nReachability = entry.first .GetReachabilityFrom (&peer. addr );
169
169
if (nReachability > nBestReachability || (nReachability == nBestReachability && nScore > nBestScore))
170
170
{
171
171
addr = CService (entry.first , entry.second .nPort );
@@ -203,10 +203,10 @@ static std::vector<CAddress> ConvertSeeds(const std::vector<uint8_t> &vSeedsIn)
203
203
// Otherwise, return the unroutable 0.0.0.0 but filled in with
204
204
// the normal parameters, since the IP may be changed to a useful
205
205
// one by discovery.
206
- CService GetLocalAddress (const CNetAddr& addrPeer )
206
+ CService GetLocalAddress (const CNode& peer )
207
207
{
208
208
CService addr;
209
- if (GetLocal (addr, &addrPeer )) {
209
+ if (GetLocal (addr, peer )) {
210
210
return addr;
211
211
}
212
212
return CService{CNetAddr (), GetListenPort ()};
@@ -229,7 +229,7 @@ bool IsPeerAddrLocalGood(CNode *pnode)
229
229
230
230
std::optional<CService> GetLocalAddrForPeer (CNode& node)
231
231
{
232
- CService addrLocal{GetLocalAddress (node. addr )};
232
+ CService addrLocal{GetLocalAddress (node)};
233
233
if (gArgs .GetBoolArg (" -addrmantest" , false )) {
234
234
// use IPv4 loopback during addrmantest
235
235
addrLocal = CService (LookupNumeric (" 127.0.0.1" , GetListenPort ()));
0 commit comments