Replace COINBASE_MATURITY...

...with nCoinbaseMaturity
This commit is contained in:
lateminer
2017-12-17 15:21:59 +03:00
parent 0252c5cea3
commit f536a8126e
7 changed files with 8 additions and 6 deletions

View File

@@ -1915,7 +1915,7 @@ bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoins
// If prev is coinbase or coinstake, check that it's matured
if (coins->IsCoinBase() || coins->IsCoinStake()) {
if (nSpendHeight - coins->nHeight < COINBASE_MATURITY)
if (nSpendHeight - coins->nHeight < Params().nCoinbaseMaturity)
return state.Invalid(
error("CheckInputs(): tried to spend %s at depth %d", coins->IsCoinBase() ? "coinbase" : "coinstake", nSpendHeight - coins->nHeight),
REJECT_INVALID, "bad-txns-premature-spend-of-coinbase");
@@ -2476,7 +2476,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
REJECT_INVALID, "bad-cs-kernel");
// Check proof-of-stake min confirmations
if (pindex->nHeight - coins->nHeight < Params().GetConsensus().nStakeMinConfirmations)
if (pindex->nHeight - coins->nHeight < chainparams.GetConsensus().nStakeMinConfirmations)
return state.DoS(100,
error("%s: tried to stake at depth %d", __func__, pindex->nHeight - coins->nHeight),
REJECT_INVALID, "bad-cs-premature");