Write+move instead of rewrite for dnsseed.dat
This commit is contained in:
parent
849daecd05
commit
2c1cd71d39
1 changed files with 6 additions and 3 deletions
9
main.cpp
9
main.cpp
|
@ -270,10 +270,13 @@ extern "C" void* ThreadDumper(void*) {
|
||||||
do {
|
do {
|
||||||
Sleep(100000);
|
Sleep(100000);
|
||||||
{
|
{
|
||||||
FILE *f = fopen("dnsseed.dat","w+");
|
FILE *f = fopen("dnsseed.dat.new","w+");
|
||||||
if (f) {
|
if (f) {
|
||||||
CAutoFile cf(f);
|
{
|
||||||
cf << db;
|
CAutoFile cf(f);
|
||||||
|
cf << db;
|
||||||
|
}
|
||||||
|
rename("dnsseed.dat.new", "dnsseed.dat");
|
||||||
}
|
}
|
||||||
FILE *d = fopen("dnsseed.dump", "w");
|
FILE *d = fopen("dnsseed.dump", "w");
|
||||||
vector<CAddrReport> v = db.GetAll();
|
vector<CAddrReport> v = db.GetAll();
|
||||||
|
|
Loading…
Reference in a new issue