Skip to content

Commit a98cd1f

Browse files
committed
net: manually resolve dns seed sources
Note: Some seeds aren't actually returning an IP for their name entries, so they're being added to addrman with a source of [::]. This commit shouldn't change that behavior, for better or worse.
1 parent e9fc71e commit a98cd1f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/net.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,15 @@ void ThreadDNSAddressSeed()
14541454
found++;
14551455
}
14561456
}
1457-
addrman.Add(vAdd, CNetAddr(seed.name, true));
1457+
// TODO: The seed name resolve may fail, yielding an IP of [::], which results in
1458+
// addrman assigning the same source to results from different seeds.
1459+
// This should switch to a hard-coded stable dummy IP for each seed name, so that the
1460+
// resolve is not required at all.
1461+
if (!vIPs.empty()) {
1462+
CService seedSource;
1463+
Lookup(seed.name.c_str(), seedSource, 0, true);
1464+
addrman.Add(vAdd, seedSource);
1465+
}
14581466
}
14591467
}
14601468

0 commit comments

Comments
 (0)