Skip to content

Commit

Permalink
Ser version 0.7.12
Browse files Browse the repository at this point in the history
  • Loading branch information
maxihatop committed Mar 4, 2023
1 parent 1766f95 commit 67c5647
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Expand Up @@ -6,11 +6,11 @@ define(_CLIENT_VERSION_REVISION, 2)

define(_EMERCOIN_VERSION_MAJOR, 0)
define(_EMERCOIN_VERSION_MINOR, 7)
define(_EMERCOIN_VERSION_REVISION, 11)
define(_EMERCOIN_VERSION_REVISION, 12)

define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2018)
define(_COPYRIGHT_YEAR, 2023)
define(_COPYRIGHT_HOLDERS,[The %s developers])
define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Emercoin Core]])
AC_INIT([Emercoin Core],[_EMERCOIN_VERSION_MAJOR._EMERCOIN_VERSION_MINOR._EMERCOIN_VERSION_REVISION],[info@emercoin.com],[emercoin])
Expand Down
2 changes: 1 addition & 1 deletion src/net.h
Expand Up @@ -93,7 +93,7 @@ static const ServiceFlags REQUIRED_SERVICES = NODE_NETWORK;
static const unsigned int DEFAULT_MISBEHAVING_BANTIME = 60 * 60 * 24; // Default 24-hour ban

/** emercoin: Number of consecutive PoS headers are allowed from a single peer. Used to prevent out of memory attack. */
static const int32_t MAX_CONSECUTIVE_POS_HEADERS = 10000;
static const int32_t MAX_CONSECUTIVE_POS_HEADERS = 174 * 90; // 90 days allowed 15660 headers

// const unsigned int POW_HEADER_COOLING = 70; - defined in protocol.cpp, so that it is visible to other files

Expand Down
22 changes: 17 additions & 5 deletions src/net_processing.cpp
Expand Up @@ -42,11 +42,23 @@

std::atomic<int64_t> nTimeBestReceived(0); // Used only to inform the wallet of when we last received a block

static int NeedBanPOS() {
static int ban_pos = -1;
if(ban_pos < 0)
ban_pos = Params().NetworkIDString() != "test" && GetBoolArg("-posprotect", false);
return ban_pos;

// posprotect - protect node from PoS header attacks
// 0 - no protection
// 1 - Protect for realtime only, no protection at initial download
// 2 - Full protection, including initial download
static bool NeedBanPOS() {
static int posprotect = -1;
if(posprotect < 0) {
posprotect = GetArg("-posprotect", 0);
//if(Params().NetworkIDString() == "test")
// posprotect = 0; // allow everything for testnet
}
switch(posprotect) {
case 0: return false;
case 1: return !IsInitialBlockDownload();
default: return true;
}
}

struct IteratorComparator
Expand Down

0 comments on commit 67c5647

Please sign in to comment.