Updated protocol version to 180004, and updated the checks to accept new IP address requests from nodes down to protocol version 180003 but only report 180004 nodes.

This commit is contained in:
Don Shin 2018-04-14 08:42:26 -05:00
parent 4e5ed5aab0
commit 2ba9805c86
3 changed files with 5 additions and 5 deletions

View File

@ -7,8 +7,8 @@ of reliable nodes via a built-in DNS server.
Features:
* regularly revisits known nodes to check their availability
* bans nodes after enough failures, or bad behaviour
* accepts nodes down to v0.3.19 to request new IP addresses from,
but only reports good post-v0.3.24 nodes.
* accepts nodes down to protocol version 180003 to request new IP addresses from,
but only reports good (180004) nodes.
* keeps statistics over (exponential) windows of 2 hours, 8 hours,
1 day and 1 week, to base decisions on.
* very low memory (a few tens of megabytes) and cpu requirements.

4
db.h
View File

@ -12,7 +12,7 @@
#define MIN_RETRY 1000
#define REQUIRE_VERSION 70001
#define REQUIRE_VERSION 180004
static inline int GetRequireHeight(const bool testnet = fTestNet)
{
@ -119,7 +119,7 @@ public:
}
int GetBanTime() const {
if (IsGood()) return 0;
if (clientVersion && clientVersion < 31900) { return 604800; }
if (clientVersion && clientVersion < 180003) { return 604800; }
if (stat1M.reliability - stat1M.weight + 1.0 < 0.15 && stat1M.count > 32) { return 30*86400; }
if (stat1W.reliability - stat1W.weight + 1.0 < 0.10 && stat1W.count > 16) { return 7*86400; }
if (stat1D.reliability - stat1D.weight + 1.0 < 0.05 && stat1D.count > 8) { return 1*86400; }

View File

@ -60,7 +60,7 @@ class CDataStream;
class CAutoFile;
static const unsigned int MAX_SIZE = 0x02000000;
static const int PROTOCOL_VERSION = 180003;
static const int PROTOCOL_VERSION = 180004;
// Used to bypass the rule against non-const reference to temporary
// where it makes sense with wrappers such as CFlatData or CTxDB