From 4b0f455274cb287b6375916e2a049fff8b299894 Mon Sep 17 00:00:00 2001 From: limxdev Date: Tue, 1 Sep 2020 15:07:30 +0200 Subject: [PATCH 1/2] Add checkpoint --- configure.ac | 2 +- src/chainparams.cpp | 3 ++- src/consensus/tx_verify.cpp | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8e073c3e..daca1541 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 90) define(_CLIENT_VERSION_REVISION, 9) -define(_CLIENT_VERSION_BUILD, 5) +define(_CLIENT_VERSION_BUILD, 6) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2020) define(_COPYRIGHT_HOLDERS,[The %s developers]) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 6ae72b0b..c0ed2e80 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -218,11 +218,12 @@ class CMainParams : public CChainParams { { 356548, uint256S("0xf62b6c5645997d078d9cb130cfe96d64ec2c047bbceca3ae8ffc373eef80b866")}, { 550000, uint256S("0xa901848fe9d22814dbb3e0f62892d3bd7a1e70f6a48a459e68ebaf24ea5d5867")}, { 590000, uint256S("0x81dc076e3b07fbc50a691ddbbe0b53ece5fe95562e54b289c589cd333f7a282a")}, + { 659006, uint256S("0xdb16bdb35d197193c18ab42259b55f0b91c4c84da94e2a49e681c4eb43d96ddb")}, } }; // BTX for faster loading - consensus.nlastValidPowHashHeight = 590000; + consensus.nlastValidPowHashHeight = 659006; chainTxData = ChainTxData{ // BTX: data as of block 0x8da1c7f79018fac8acac69a57b2f8b5d2743af67976a4525fdedc8c85a3a1418 (height 410476). 1588381219, // * UNIX timestamp of last known number of transactions diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp index 980a219d..85ec643c 100644 --- a/src/consensus/tx_verify.cpp +++ b/src/consensus/tx_verify.cpp @@ -237,12 +237,33 @@ bool Consensus::CheckTxInputs(const CTransaction& tx, CValidationState& state, c } else { + /* if (coin.IsCoinBase() && nSpendHeight - coin.nHeight < (!sporkManager.IsSporkActive(SPORK_BTX_16_COINBASE_MATURITY_STAGE_3)? COINBASE_MATURITY_2 : COINBASE_MATURITY_3 )) { return state.Invalid(false, REJECT_INVALID, "bad-txns-premature-spend-of-coinbase", strprintf("tried to spend coinbase at depth %d", nSpendHeight - coin.nHeight)); } + */ + if (AHeight < 659003) + { + if (coin.IsCoinBase() && nSpendHeight - coin.nHeight < COINBASE_MATURITY_2 ) + { + return state.Invalid(false, + REJECT_INVALID, "bad-txns-premature-spend-of-coinbase", + strprintf("tried to spend coinbase at depth %d", nSpendHeight - coin.nHeight)); + } + } + else + { + if (coin.IsCoinBase() && nSpendHeight - coin.nHeight < COINBASE_MATURITY_3 ) + { + return state.Invalid(false, + REJECT_INVALID, "bad-txns-premature-spend-of-coinbase", + strprintf("tried to spend coinbase at depth %d", nSpendHeight - coin.nHeight)); + } + } + } /* if (coin.IsCoinBase() && nSpendHeight - coin.nHeight < (!sporkManager.IsSporkActive(SPORK_BTX_16_COINBASE_MATURITY_STAGE_3)? COINBASE_MATURITY_2 : COINBASE_MATURITY_3 )) { From acdf0c9f55235a5a4d17700990c10033101113f8 Mon Sep 17 00:00:00 2001 From: limxdev Date: Tue, 1 Sep 2020 15:11:56 +0200 Subject: [PATCH 2/2] Update wallet.cpp --- src/wallet/wallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index dc323e51..72a88773 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -5612,9 +5612,9 @@ int CMerkleTx::GetBlocksToMaturity() const chain_depth = 0; // FXTC END assert(chain_depth >= 0); // coinbase tx should not be conflicted - //return std::max(0, (COINBASE_MATURITY+1) - chain_depth); + return std::max(0, (COINBASE_MATURITY_3 +1) - chain_depth); // BTX BEGIN - return std::max(0, ((!sporkManager.IsSporkActive(SPORK_BTX_15_COINBASE_MATURITY_STAGE_2)? COINBASE_MATURITY : COINBASE_MATURITY_2 )+1) - chain_depth); + //return std::max(0, ((!sporkManager.IsSporkActive(SPORK_BTX_15_COINBASE_MATURITY_STAGE_2)? COINBASE_MATURITY : //COINBASE_MATURITY_3 )+1) - chain_depth); // BTX END }