diff options
| author | Ross Nicoll <[email protected]> | 2021-03-03 21:22:15 +0000 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2021-05-20 12:02:35 +0100 |
| commit | 3f8289a113ad2fb629c787528c809aa7d5b91610 (patch) | |
| tree | 073b9f822df735b78b18cc1de6b40991f568f07d /src/validation.cpp | |
| parent | Update miner confirmation window (diff) | |
| download | discoin-3f8289a113ad2fb629c787528c809aa7d5b91610.tar.xz discoin-3f8289a113ad2fb629c787528c809aa7d5b91610.zip | |
Dogecoin: Update coinbase maturity
* Change coinbase maturity to 240 blocks in most cases, with main/test early chains allowing 30 blocks. I've kept the 240 consistent in regtest to avoid having to redesign a lot of the test cases.
* Disabled mining unit test which require COINBASE_MATURITY worth of pre-calculated blocks, as we'd otherwise be constantly refactoring them.
* Moved functional test which uses the Bitcoin testnet block data as its reference, as it completely breaks as we introduce Dogecoin data.
* Updated standard blockchains for tests from 100/200 to 240/480 as appropriate.
Diffstat (limited to 'src/validation.cpp')
| -rw-r--r-- | src/validation.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index feb7502a0..5252d50d0 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -680,7 +680,8 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) return state.Invalid(TxValidationResult::TX_PREMATURE_SPEND, "non-BIP68-final"); CAmount nFees = 0; - if (!Consensus::CheckTxInputs(tx, state, m_view, GetSpendHeight(m_view), nFees)) { + const auto& params = args.m_chainparams.GetConsensus(); + if (!Consensus::CheckTxInputs(tx, state, m_view, GetSpendHeight(m_view), nFees, params)) { return false; // state filled in by CheckTxInputs } @@ -690,7 +691,6 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) } // Check for non-standard pay-to-script-hash in inputs - const auto& params = args.m_chainparams.GetConsensus(); auto taproot_state = VersionBitsState(::ChainActive().Tip(), params, Consensus::DEPLOYMENT_TAPROOT, versionbitscache); if (fRequireStandard && !AreInputsStandard(tx, m_view, taproot_state == ThresholdState::ACTIVE)) { return state.Invalid(TxValidationResult::TX_INPUTS_NOT_STANDARD, "bad-txns-nonstandard-inputs"); @@ -2149,7 +2149,7 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state, { CAmount txfee = 0; TxValidationState tx_state; - if (!Consensus::CheckTxInputs(tx, tx_state, view, pindex->nHeight, txfee)) { + if (!Consensus::CheckTxInputs(tx, tx_state, view, pindex->nHeight, txfee, chainparams.GetConsensus())) { // Any transaction validation failure in ConnectBlock is a block consensus failure state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, tx_state.GetRejectReason(), tx_state.GetDebugMessage()); |