Gradually decrease dump frequency

This commit is contained in:
Pieter Wuille 2013-04-15 12:01:32 +02:00
parent e1876bf199
commit 9943b90c54
2 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
CXXFLAGS = -O3 -g0 -march=native -flto
CXXFLAGS = -O3 -g0 -march=nocona -flto
LDFLAGS = $(CXXFLAGS)
dnsseed: dns.o bitcoin.o netbase.o protocol.o db.o main.o util.o

View File

@ -267,8 +267,11 @@ int StatCompare(const CAddrReport& a, const CAddrReport& b) {
}
extern "C" void* ThreadDumper(void*) {
int count = 0;
do {
Sleep(100000);
Sleep(100000 << count); // First 100s, than 200s, 400s, 800s, 1600s, and then 3200s forever
if (count < 5)
count++;
{
vector<CAddrReport> v = db.GetAll();
sort(v.begin(), v.end(), StatCompare);