|
|
|
@ -440,7 +440,7 @@ void ThreadGetMyExternalIP(void* parg)
@@ -440,7 +440,7 @@ void ThreadGetMyExternalIP(void* parg)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool AddAddress(CAddress addr, int64 nTimePenalty) |
|
|
|
|
bool AddAddress(CAddress addr, int64 nTimePenalty, CAddrDB *pAddrDB) |
|
|
|
|
{ |
|
|
|
|
if (!addr.IsRoutable()) |
|
|
|
|
return false; |
|
|
|
@ -455,7 +455,10 @@ bool AddAddress(CAddress addr, int64 nTimePenalty)
@@ -455,7 +455,10 @@ bool AddAddress(CAddress addr, int64 nTimePenalty)
|
|
|
|
|
// New address
|
|
|
|
|
printf("AddAddress(%s)\n", addr.ToString().c_str()); |
|
|
|
|
mapAddresses.insert(make_pair(addr.GetKey(), addr)); |
|
|
|
|
CAddrDB().WriteAddress(addr); |
|
|
|
|
if (pAddrDB) |
|
|
|
|
pAddrDB->WriteAddress(addr); |
|
|
|
|
else |
|
|
|
|
CAddrDB().WriteAddress(addr); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
@ -477,7 +480,12 @@ bool AddAddress(CAddress addr, int64 nTimePenalty)
@@ -477,7 +480,12 @@ bool AddAddress(CAddress addr, int64 nTimePenalty)
|
|
|
|
|
fUpdated = true; |
|
|
|
|
} |
|
|
|
|
if (fUpdated) |
|
|
|
|
CAddrDB().WriteAddress(addrFound); |
|
|
|
|
{ |
|
|
|
|
if (pAddrDB) |
|
|
|
|
pAddrDB->WriteAddress(addrFound); |
|
|
|
|
else |
|
|
|
|
CAddrDB().WriteAddress(addrFound); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
@ -1158,6 +1166,8 @@ void DNSAddressSeed()
@@ -1158,6 +1166,8 @@ void DNSAddressSeed()
|
|
|
|
|
if (!fTestNet) |
|
|
|
|
{ |
|
|
|
|
printf("Loading addresses from DNS seeds (could take a while)\n"); |
|
|
|
|
CAddrDB addrDB; |
|
|
|
|
addrDB.TxnBegin(); |
|
|
|
|
|
|
|
|
|
for (int seed_idx = 0; seed_idx < ARRAYLEN(strDNSSeed); seed_idx++) { |
|
|
|
|
vector<CAddress> vaddr; |
|
|
|
@ -1168,12 +1178,14 @@ void DNSAddressSeed()
@@ -1168,12 +1178,14 @@ void DNSAddressSeed()
|
|
|
|
|
if (addr.GetByte(3) != 127) |
|
|
|
|
{ |
|
|
|
|
addr.nTime = 0; |
|
|
|
|
AddAddress(addr); |
|
|
|
|
AddAddress(addr, 0, &addrDB); |
|
|
|
|
found++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
addrDB.TxnCommit(); // Save addresses (it's ok if this fails)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
printf("%d addresses found from DNS seeds\n", found); |
|
|
|
|