aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorStéphane Gimenez <dev@gim.name>2011-07-14 02:57:39 +0200
committerStéphane Gimenez <dev@gim.name>2011-07-14 03:50:06 +0200
commitd655a26c9dd157a9e4bf08bff14bfaa69791287a (patch)
tree809ec2e92ae795dbe006b3f4c94f0631f4db02e7 /src/net.cpp
parent8c41469140584f3cbdd09fb62a1287da0216f431 (diff)
Single DB transaction for addresses from DNS seeds
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index dcfff934b6..2a90f6d0cc 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1166,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;
@@ -1176,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);