Skip to content

Commit

Permalink
remove devfund code
Browse files Browse the repository at this point in the history
  • Loading branch information
mclxi committed Jun 15, 2018
1 parent 395f299 commit adfc228
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
30 changes: 15 additions & 15 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1804,13 +1804,13 @@ CAmount GetMainBlockReward(int nPrevHeight) {
blockReward = 625;
}

if(((nPrevHeight) % 100 == 0) && nPrevHeight >= 13788) {
blockReward = blockReward*10;
} else {
if (nPrevHeight >= 13788){
blockReward *= 0.9;
}
}
//if(((nPrevHeight) % 100 == 0) && nPrevHeight >= 13788) {
// blockReward = blockReward*10;
//} else {
// if (nPrevHeight >= 13788){
// blockReward *= 0.9;
// }
// }
return blockReward * COIN;
}

Expand All @@ -1831,12 +1831,12 @@ CAmount getblkreward(int nPrevHeight){
CAmount GetMasternodePayment(int nHeight, CAmount blockReward)
{
CAmount blockValue;
if ((nHeight-1) % 100 == 0 && nHeight > 13788){
return blockReward * .9999;
}
else {
//if ((nHeight-1) % 100 == 0 && nHeight > 13788){
// return blockReward * .9999;
// }
// else {
blockValue = blockReward;
}
//}
// CAmount blockValue = ((nHeight % 100 == 0) && nHeight >13788) ? return blockReward * 0.999 : blockReward;
//return blockValue * 0.40;
//blockValue = ((nHeight % 100 == 0) && nHeight > 15799) ? getblkreward(nHeight -1) : blockValue;
Expand Down Expand Up @@ -2966,7 +2966,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin

return true;
}
bool CheckDevFundPayment(const CTransaction& txNew, int nBlockHeight) {
//bool CheckDevFundPayment(const CTransaction& txNew, int nBlockHeight) {
/* if (nBlockHeight >= Params().GetConsensus().nDevFundPaymentsStartBlock && !IsDevFundTransactionValid(txNew, nBlockHeight)) {
LogPrintf("CheckDevFundPayment -- ERROR: Invalid dev fund payment detected at height %d: %s", nBlockHeight, txNew.ToString());
Expand All @@ -2981,7 +2981,7 @@ bool CheckDevFundPayment(const CTransaction& txNew, int nBlockHeight) {
}
*/ // HF
if (chainActive.Height() > 13788 && (chainActive.Height()+1 % 100 ==0)) {
/* if (chainActive.Height() > 13788 && (chainActive.Height()+1 % 100 ==0)) {
//CAmount dpmPayment = 20000 * COIN;
CAmount blkreward = (getblkreward(chainActive.Height()-5) / 0.9) * 10;
CAmount dpmPayment = blkreward;
Expand All @@ -3005,7 +3005,7 @@ bool CheckDevFundPayment(const CTransaction& txNew, int nBlockHeight) {
}
return true;
}
}*/

enum FlushStateMode {
FLUSH_STATE_NONE,
Expand Down
32 changes: 16 additions & 16 deletions src/masternode-payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,13 @@ void CMasternodePayments::FillBlockPayee(CMutableTransaction& txNew, int nBlockH
return;
}
// fill payee with locally calculated winner and hope for the best
if(!((nBlockHeight - 1) % 100 == 0 && nBlockHeight >= 13788)) {
//if(!((nBlockHeight - 1) % 100 == 0 && nBlockHeight >= 13788)) {
payee = GetScriptForDestination(winningNode->pubKeyCollateralAddress.GetID());
}
else{
CBitcoinAddress VfundAddress("CJWBXVd3wF5H1oxZP9sPNGoNCzTWCPPnQD");
payee = GetScriptForDestination(VfundAddress.Get());
}
//}
//else{
//CBitcoinAddress VfundAddress("CJWBXVd3wF5H1oxZP9sPNGoNCzTWCPPnQD");
//payee = GetScriptForDestination(VfundAddress.Get());
// }
}

// GET MASTERNODE PAYMENT VARIABLES SETUP
Expand All @@ -308,14 +308,14 @@ void CMasternodePayments::FillBlockPayee(CMutableTransaction& txNew, int nBlockH
txNew.vout.push_back(txoutDevfundRet);
}
*/
if(!((nBlockHeight - 1) % 100 == 0 && nBlockHeight >= 13788)) {
// if(!((nBlockHeight - 1) % 100 == 0 && nBlockHeight >= 13788)) {
CTxDestination address1;
ExtractDestination(payee, address1);
CBitcoinAddress address2(address1);
LogPrintf("Extractdestination: %s",address2.ToString());

LogPrintf("CMasternodePayments::FillBlockPayee -- Masternode payment %lld to %s\n", masternodePayment, address2.ToString());
}
//}
}

int CMasternodePayments::GetMinMasternodePaymentsProto() {
Expand Down Expand Up @@ -589,14 +589,14 @@ bool CMasternodeBlockPayees::IsTransactionValid(const CTransaction& txNew)
LogPrint("mnpayments", "CMasternodeBlockPayees::IsTransactionValid -- Found required payment\n");
return true;
}
else if( ((nBlockHeight - 1) % 100 == 0 && nBlockHeight >= 13788)) {
CBitcoinAddress VfundAddress2("RVGiq7UfWZoeSNXM3nkXiHz7o1pxEbFnMC");
CScript VfundPayee2 = GetScriptForDestination(VfundAddress2.Get());

if (VfundPayee2 == txout.scriptPubKey && nMasternodePayment == txout.nValue) {
return true;
}
}
//else if( ((nBlockHeight - 1) % 100 == 0 && nBlockHeight >= 13788)) {
//CBitcoinAddress VfundAddress2("RVGiq7UfWZoeSNXM3nkXiHz7o1pxEbFnMC");
//CScript VfundPayee2 = GetScriptForDestination(VfundAddress2.Get());

//if (VfundPayee2 == txout.scriptPubKey && nMasternodePayment == txout.nValue) {
// return true;
// }
//}
}

CTxDestination address1;
Expand Down
4 changes: 2 additions & 2 deletions src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const CScript& s
// Compute regular coinbase transaction.
txNew.vout[0].nValue = blockReward;
txNew.vin[0].scriptSig = CScript() << nHeight << OP_0;
if (pindexPrev->nHeight < 12788) {
if (pindexPrev->nHeight < 2800) {
FOUNDER_REWARD = false;
}
else {
FOUNDER_REWARD = true;
}
if (pindexPrev->nHeight < 12788) {
if (pindexPrev->nHeight < 2800) {
//pay founders reward
//if ((nHeight > 0) && (nHeight <= Params().GetConsensus().GetLastFoundersRewardBlockHeight())) {
if(Params().NetworkIDString() =="test") {
Expand Down

0 comments on commit adfc228

Please sign in to comment.