Dump header

This commit is contained in:
Pieter Wuille 2012-02-24 00:57:06 +01:00
parent f4aa8699b4
commit d4349d6480

View file

@ -177,6 +177,7 @@ extern "C" void* ThreadDumper(void*) {
FILE *d = fopen("dnsseed.dump", "w"); FILE *d = fopen("dnsseed.dump", "w");
vector<CAddrReport> v = db.GetAll(); vector<CAddrReport> v = db.GetAll();
sort(v.begin(), v.end(), StatCompare); sort(v.begin(), v.end(), StatCompare);
fprintf(d, "# address \t%%(2h)\t%%(8h)\t%%(1d)\t%%(7d)\t%%(30d)\tversion\n");
for (vector<CAddrReport>::const_iterator it = v.begin(); it < v.end(); it++) { for (vector<CAddrReport>::const_iterator it = v.begin(); it < v.end(); it++) {
CAddrReport rep = *it; CAddrReport rep = *it;
fprintf(d, "%s\t%.2f%%\t%.2f%%\t%.2f%%\t%.2f%%\t%.2f%%\t%i \"%s\"\n", rep.ip.ToString().c_str(), 100.0*rep.uptime[0], 100.0*rep.uptime[1], 100.0*rep.uptime[2], 100.0*rep.uptime[3], 100.0*rep.uptime[4], rep.clientVersion, rep.clientSubVersion.c_str()); fprintf(d, "%s\t%.2f%%\t%.2f%%\t%.2f%%\t%.2f%%\t%.2f%%\t%i \"%s\"\n", rep.ip.ToString().c_str(), 100.0*rep.uptime[0], 100.0*rep.uptime[1], 100.0*rep.uptime[2], 100.0*rep.uptime[3], 100.0*rep.uptime[4], rep.clientVersion, rep.clientSubVersion.c_str());