Skip to content

Commit

Permalink
1.1.9.9b-Mandatory Upgrade
Browse files Browse the repository at this point in the history
- Remove POG in Prod to prevent external attack vectors
- Fix boost::lexical cast error during syncing
  • Loading branch information
biblepay committed Mar 13, 2019
1 parent 94e066a commit 962ffe5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/governance-classes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,15 +676,14 @@ CAmount CSuperblock::GetPaymentsLimit(int nBlockHeight)
int nBits = 486585255; // Set diff at about 1.42 for Superblocks
int nSuperblockCycle = IsValidBlockHeight(nBlockHeight) ? consensusParams.nSuperblockCycle : consensusParams.nDCCSuperblockCycle;
// At block 98400, our budget = 13,518,421 (.814 budget factor)

double nBudgetFactor = 1;
// The first call to GetBlockSubsidy calculates the future reward (and this has our standard deflation of 19% per year in it)
CAmount nSuperblockPartOfSubsidy = GetBlockSubsidy(pindexBestHeader->pprev, nBits, nBlockHeight, consensusParams, true);

// If this is a DC Superblock, and we exceed F12000 Cutover Height, due to cascading superblocks, the DC superblock budget should be 70% of the budget:

if (nBlockHeight > 106150 && nBlockHeight < 107001 && IsDCCSuperblock(nBlockHeight)) nBudgetFactor = 1.75;
CAmount nPaymentsLimit = nSuperblockPartOfSubsidy * nSuperblockCycle * nBudgetFactor;

if (nBlockHeight > 107000 && nPaymentsLimit > (13500000*COIN)) nPaymentsLimit = 13500000 * COIN;
LogPrint("gobject", "CSuperblock::GetPaymentsLimit -- Valid superblock height %f, payments max %f \n",(double)nBlockHeight, (double)nPaymentsLimit/COIN);

Expand Down
7 changes: 5 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4575,9 +4575,9 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
}
}

// Rob A., Biblepay, 3/7/2018, Kick Off BotNet Rules
// Rob A., Biblepay, 3/7/2018, Kick Off BotNet Rules (The following POG check should be disabled until Evolution)
double dBlockVersion = GetBlockVersion(block.vtx[0]);
if (fProd && nHeight > POG_V3_CUTOVER_HEIGHT_PROD && dBlockVersion < 1199)
if (false && fProd && nHeight > POG_V3_CUTOVER_HEIGHT_PROD && dBlockVersion < 1199)
{
return state.DoS(10, error("%s: Rejecting pog block version < 1189", __func__), REJECT_INVALID, "bad-block-version");
}
Expand Down Expand Up @@ -6254,6 +6254,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
std::string sVersion = pfrom->cleanSubVer;
sVersion = strReplace(sVersion, "Biblepay Core:", "");
sVersion = strReplace(sVersion, "Praise Jesus", "");
sVersion = strReplace(sVersion, "Develop", "");
sVersion = strReplace(sVersion, "Main", "");
sVersion = strReplace(sVersion, "Test", "");
sVersion = strReplace(sVersion, ":", "");
sVersion = strReplace(sVersion, "-", "");
sVersion = strReplace(sVersion, "/", "");
Expand Down
2 changes: 1 addition & 1 deletion src/masternode-payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bool IsBlockValueValid(const CBlock& block, int nBlockHeight, CAmount blockRewar
{

if (!fProd && nBlockHeight < 79999) return true; // Special case for Testnet superblocks up to block 999 - 1/23/2019
if (fProd && nBlockHeight < 100000) return true;
if (fProd && nBlockHeight < 106999) return true;
strErrorRet = "";
bool isBlockRewardValueMet = (block.vtx[0].GetValueOut() <= blockReward);
if(!isBlockRewardValueMet && fDebugMaster)
Expand Down
6 changes: 3 additions & 3 deletions src/podc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,16 +444,16 @@ double cdbl(std::string s, int place)
try
{
double r = boost::lexical_cast<double>(t);
double d = Round(r,place);
double d = Round(r, place);
return d;
}
catch(boost::bad_lexical_cast const& e)
{
LogPrintf("podc-cdbl bad lexical cast.");
LogPrintf("podc-cdbl bad lexical cast %s.", s.c_str());
}
catch(...)
{
LogPrintf("podc-cdbl bad lexical cast II.");
LogPrintf("podc-cdbl bad lexical cast II. %s", s.c_str());
}
return 0;
}
Expand Down

0 comments on commit 962ffe5

Please sign in to comment.