Browse Source

HUSH MOD

* HUSH nodes only
master
Lucky-Mining 6 years ago
parent
commit
3ee4ada339
  1. 8
      coin.h
  2. 18
      db.h

8
coin.h

@ -26,4 +26,12 @@ static const int minimunClientVersion = 170002;
static const int PROTOCOL_VERSION = 170002;
static const int INIT_PROTO_VERSION = 209;
// HUSH MOD
static const std::string SUBV1 = "/BalefulStatic:1.0.9/";
static const std::string SUBV2 = "/BalefulStatic:1.0.12/";
static const std::string SUBV3 = "/BalefulStatic:1.0.13/";
static const std::string SUBV4 = "/BalefulStatic:1.0.14/";
static const std::string SUBV5 = "/AuspiciousHerald:2.0.0/";
// END
#endif // __INCLUDED_COIN_H__

18
db.h

@ -105,6 +105,15 @@ public:
if (!(services & NODE_NETWORK)) return false;
if (!ip.IsRoutable()) return false;
if (clientVersion && clientVersion < REQUIRE_VERSION) return false;
// HUSH MOD
if ((clientSubVersion != SUBV1) &&
(clientSubVersion != SUBV2) &&
(clientSubVersion != SUBV3) &&
(clientSubVersion != SUBV4) &&
(clientSubVersion != SUBV5)) return false;
// END
if (blocks && blocks < GetRequireHeight()) return false;
if (total <= 3 && success * 2 >= total) return true;
@ -120,6 +129,15 @@ public:
int GetBanTime() const {
if (IsGood()) return 0;
if (clientVersion && clientVersion < minimunClientVersion) { return 604800; }
// HUSH MOD
if ((clientSubVersion != SUBV1) &&
(clientSubVersion != SUBV2) &&
(clientSubVersion != SUBV3) &&
(clientSubVersion != SUBV4) &&
(clientSubVersion != SUBV5)) { return 604800; }
// END
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; }

Loading…
Cancel
Save