mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 18:09:47 +01:00
Only consider addrv2 peers for relay of non-addrv1 addresses
This commit is contained in:
parent
83f8821a6f
commit
37fe80e626
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user