mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Single DB transaction for addresses from DNS seeds
This commit is contained in:
parent
8c41469140
commit
d655a26c9d
@ -1166,6 +1166,8 @@ void DNSAddressSeed()
|
|||||||
if (!fTestNet)
|
if (!fTestNet)
|
||||||
{
|
{
|
||||||
printf("Loading addresses from DNS seeds (could take a while)\n");
|
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++) {
|
for (int seed_idx = 0; seed_idx < ARRAYLEN(strDNSSeed); seed_idx++) {
|
||||||
vector<CAddress> vaddr;
|
vector<CAddress> vaddr;
|
||||||
@ -1176,12 +1178,14 @@ void DNSAddressSeed()
|
|||||||
if (addr.GetByte(3) != 127)
|
if (addr.GetByte(3) != 127)
|
||||||
{
|
{
|
||||||
addr.nTime = 0;
|
addr.nTime = 0;
|
||||||
AddAddress(addr);
|
AddAddress(addr, 0, &addrDB);
|
||||||
found++;
|
found++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addrDB.TxnCommit(); // Save addresses (it's ok if this fails)
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%d addresses found from DNS seeds\n", found);
|
printf("%d addresses found from DNS seeds\n", found);
|
||||||
|
Loading…
Reference in New Issue
Block a user