Merge #10215: Check interruptNet during dnsseed lookups

b2c9254 Check interruptNet during dnsseed lookups (Matt Corallo)

Tree-SHA512: a76b5749b085d5571ac65a6925bb1c50fa1d02c02854d9126224dc2ec419eb9103f7c92bf9a0bbd39c7dee93a2266dc3973fb16b48e8daea057f45d452e2513c
This commit is contained in:
Pieter Wuille 2017-04-17 05:08:19 -07:00 committed by Alexander Block
parent 69058b83f7
commit ee3ff3552d

View File

@ -1584,6 +1584,9 @@ void CConnman::ThreadDNSAddressSeed()
LogPrintf("Loading addresses from DNS seeds (could take a while)\n"); LogPrintf("Loading addresses from DNS seeds (could take a while)\n");
BOOST_FOREACH(const CDNSSeedData &seed, vSeeds) { BOOST_FOREACH(const CDNSSeedData &seed, vSeeds) {
if (interruptNet) {
return;
}
if (HaveNameProxy()) { if (HaveNameProxy()) {
AddOneShot(seed.host); AddOneShot(seed.host);
} else { } else {
@ -1601,6 +1604,9 @@ void CConnman::ThreadDNSAddressSeed()
found++; found++;
} }
} }
if (interruptNet) {
return;
}
// TODO: The seed name resolve may fail, yielding an IP of [::], which results in // TODO: The seed name resolve may fail, yielding an IP of [::], which results in
// addrman assigning the same source to results from different seeds. // addrman assigning the same source to results from different seeds.
// This should switch to a hard-coded stable dummy IP for each seed name, so that the // This should switch to a hard-coded stable dummy IP for each seed name, so that the