diff --git a/db.cpp b/db.cpp index 1d9ca15..526e779 100644 --- a/db.cpp +++ b/db.cpp @@ -7,11 +7,6 @@ void CAddrInfo::Update(bool good) { uint32_t now = time(NULL); if (ourLastTry == 0) ourLastTry = now - MIN_RETRY; - double f = exp(-(now-ourLastTry)/TAU); - reliability = reliability * f + (good ? (1.0-f) : 0); - timing = (timing + (now-ourLastTry) * weight) * f; - count = count * f + 1; - weight = weight * f + (1.0-f); lastTry = now; ourLastTry = now; total++; diff --git a/db.h b/db.h index e3ee55d..6ad869d 100644 --- a/db.h +++ b/db.h @@ -19,6 +19,18 @@ std::string static inline ToString(const CIPPort &ip) { return str; } +template class CAddrStat { +private: + float reliability; + float timing; + float count; + float weight; +public: + void Update(bool good, int64 tim) { + + } +} + class CAddrInfo { private: CIPPort ip;