From 8286cf33f1a1a6739eef3de31842f5d3bc2f1afa Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 22 Dec 2011 03:25:35 +0100 Subject: [PATCH] begin multitau --- db.cpp | 5 ----- db.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) 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;