aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2020-12-15 09:57:23 -0800
committerPieter Wuille <pieter@wuille.net>2020-12-15 12:45:41 -0800
commit37fe80e6267094f6051ccf9bec0c7f1a6b9e15da (patch)
treee94284e18548319444939de4222880a4838237de /src
parent83f8821a6f41854edd5c0b11deabba658890cde1 (diff)
Only consider addrv2 peers for relay of non-addrv1 addresses
Diffstat (limited to 'src')
-rw-r--r--src/net_processing.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 05e5681df3..a33c4a0bd4 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1443,8 +1443,8 @@ static void RelayAddress(const CNode& originator,
std::array<std::pair<uint64_t, CNode*>,2> best{{{0, nullptr}, {0, nullptr}}};
assert(nRelayNodes <= best.size());
- auto sortfunc = [&best, &hasher, nRelayNodes, &originator](CNode* pnode) {
- if (pnode->RelayAddrsWithConn() && pnode != &originator) {
+ auto sortfunc = [&best, &hasher, nRelayNodes, &originator, &addr](CNode* pnode) {
+ if (pnode->RelayAddrsWithConn() && pnode != &originator && pnode->IsAddrCompatible(addr)) {
uint64_t hashKey = CSipHasher(hasher).Write(pnode->GetId()).Finalize();
for (unsigned int i = 0; i < nRelayNodes; i++) {
if (hashKey > best[i].first) {