Gradually decrease dump frequency
This commit is contained in:
parent
e1876bf199
commit
9943b90c54
2 changed files with 5 additions and 2 deletions
2
Makefile
2
Makefile
|
@ -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
|
||||
|
|
5
main.cpp
5
main.cpp
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue