Skip to content

Commit

Permalink
Remote activation patch 120k
Browse files Browse the repository at this point in the history
  • Loading branch information
gades committed Feb 11, 2019
1 parent b16176f commit fcca844
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,7 @@ strUsage += "\n" + _("Masternode options:") + "\n";
" -nosmsg " + _("Disable secure messaging.") + "\n" +
" -debugsmsg " + _("Log extra debug messages.") + "\n" +
" -smsgscanchain " + _("Scan the block chain for public key addresses on startup.") + "\n" +
strUsage += " -stakethreshold=<n> " + _("This will set the output size of your stakes to never be below this number (default: 250)") + "\n" +
strUsage += " -softfork120k=<n> " + _("This will activate soft fork at 120 000 block (default: false)") + "\n";
strUsage += " -stakethreshold=<n> " + _("This will set the output size of your stakes to never be below this number (default: 250)") + "\n";

return strUsage;
}
Expand Down
3 changes: 1 addition & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ bool fReindex = false;
bool fAddrIndex = false;
bool fHaveGUI = false;

static bool isSoftForkEnabled() { return GetArg("-softfork120k", false); }

struct COrphanBlock {
uint256 hashBlock;
Expand Down Expand Up @@ -1465,7 +1464,7 @@ bool IsWalletGracePeriod()
WalletStart = GetTime();
LogPrintf("Updated start time is : %d \n", WalletStart);
}
if (!isSoftForkEnabled())
if (!IsSporkActive(SPORK_120K))
return true;
if (GetTime() < WalletStart + 3600) {
return true;
Expand Down
1 change: 1 addition & 0 deletions src/rpcmisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Value getinfo(const Array& params, bool fHelp)
{
obj.push_back(Pair("GracePeriodCount", (int)gCount));
}
obj.push_back(Pair("Patch120k", IsSporkActive(SPORK_120K)));
#ifdef ENABLE_WALLET
if (pwalletMain) {
obj.push_back(Pair("keypoololdest", (int64_t)pwalletMain->GetOldestKeyPoolTime()));
Expand Down
4 changes: 4 additions & 0 deletions src/spork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ bool IsSporkActive(int nSporkID)
if(nSporkID == SPORK_11_RESET_BUDGET) r = SPORK_11_RESET_BUDGET_DEFAULT;
if(nSporkID == SPORK_12_RECONSIDER_BLOCKS) r = SPORK_12_RECONSIDER_BLOCKS_DEFAULT;
if(nSporkID == SPORK_13_ENABLE_SUPERBLOCKS) r = SPORK_13_ENABLE_SUPERBLOCKS_DEFAULT;
if(nSporkID == SPORK_120K) r = SPORK_120K_DEFAULT;

if(r == -1) LogPrintf("GetSpork::Unknown Spork %d\n", nSporkID);
}
Expand Down Expand Up @@ -125,6 +126,7 @@ int64_t GetSporkValue(int nSporkID)
if(nSporkID == SPORK_11_RESET_BUDGET) r = SPORK_11_RESET_BUDGET_DEFAULT;
if(nSporkID == SPORK_12_RECONSIDER_BLOCKS) r = SPORK_12_RECONSIDER_BLOCKS_DEFAULT;
if(nSporkID == SPORK_13_ENABLE_SUPERBLOCKS) r = SPORK_13_ENABLE_SUPERBLOCKS_DEFAULT;
if(nSporkID == SPORK_120K) r = SPORK_120K_DEFAULT;

if(r == -1) LogPrintf("GetSpork::Unknown Spork %d\n", nSporkID);
}
Expand Down Expand Up @@ -265,6 +267,7 @@ int CSporkManager::GetSporkIDByName(std::string strName)
if(strName == "SPORK_11_RESET_BUDGET") return SPORK_11_RESET_BUDGET;
if(strName == "SPORK_12_RECONSIDER_BLOCKS") return SPORK_12_RECONSIDER_BLOCKS;
if(strName == "SPORK_13_ENABLE_SUPERBLOCKS") return SPORK_13_ENABLE_SUPERBLOCKS;
if(strName == "SPORK_120K") return SPORK_120K;

return -1;
}
Expand All @@ -283,6 +286,7 @@ std::string CSporkManager::GetSporkNameByID(int id)
if(id == SPORK_11_RESET_BUDGET) return "SPORK_11_RESET_BUDGET";
if(id == SPORK_12_RECONSIDER_BLOCKS) return "SPORK_12_RECONSIDER_BLOCKS";
if(id == SPORK_13_ENABLE_SUPERBLOCKS) return "SPORK_13_ENABLE_SUPERBLOCKS";
if(id == SPORK_120K) return "SPORK_120K";

return "Unknown";
}
2 changes: 2 additions & 0 deletions src/spork.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ using namespace boost;
#define SPORK_11_RESET_BUDGET 10010
#define SPORK_12_RECONSIDER_BLOCKS 10011
#define SPORK_13_ENABLE_SUPERBLOCKS 10012
#define SPORK_120K 120000

#define SPORK_1_MASTERNODE_PAYMENTS_ENFORCEMENT_DEFAULT 2428537599 //2015-4-8 23:59:59 GMT // NOT USED
#define SPORK_2_INSTANTX_DEFAULT 978307200 //2001-1-1 23:59:59 GMT
Expand All @@ -45,6 +46,7 @@ using namespace boost;
#define SPORK_11_RESET_BUDGET_DEFAULT 0
#define SPORK_12_RECONSIDER_BLOCKS_DEFAULT 0
#define SPORK_13_ENABLE_SUPERBLOCKS_DEFAULT 4070908800 //OFF
#define SPORK_120K_DEFAULT 4070908800 //OFF

class CSporkMessage;
class CSporkManager;
Expand Down

0 comments on commit fcca844

Please sign in to comment.