diff --git a/db.cpp b/db.cpp index 5b111b0..55277c0 100644 --- a/db.cpp +++ b/db.cpp @@ -61,7 +61,7 @@ bool CAddrDb::Get_(CIPPort &ip, int &wait) { } unkId.erase(ret); } else { - int ret = ourId.front(); + ret = ourId.front(); if (time(NULL) - idToInfo[ret].ourLastTry < MIN_RETRY) return false; ourId.pop_front(); } @@ -169,7 +169,7 @@ void CAddrDb::Add_(const CAddress &addr) { int id = nId++; idToInfo[id] = ai; ipToId[ipp] = id; - printf("%s: added\n", ToString(ipp).c_str(), ipToId[ipp]); +// printf("%s: added\n", ToString(ipp).c_str(), ipToId[ipp]); unkId.insert(id); nDirty++; } diff --git a/db.h b/db.h index c85c5ae..f590274 100644 --- a/db.h +++ b/db.h @@ -100,15 +100,19 @@ public: READWRITE(ip); READWRITE(services); READWRITE(lastTry); - READWRITE(ourLastTry); - READWRITE(ignoreTill); - READWRITE(stat2H); - READWRITE(stat8H); - READWRITE(stat1D); - READWRITE(stat1W); - READWRITE(total); - READWRITE(success); - READWRITE(clientVersion); + unsigned char tried = ourLastTry != 0; + READWRITE(tried); + if (tried) { + READWRITE(ourLastTry); + READWRITE(ignoreTill); + READWRITE(stat2H); + READWRITE(stat8H); + READWRITE(stat1D); + READWRITE(stat1W); + READWRITE(total); + READWRITE(success); + READWRITE(clientVersion); + } ) };