Enable time locked coin bases to be used as normal coinbase transactions with longer maturity, fix max_money

This commit is contained in:
miketout
2018-05-04 16:33:34 -07:00
parent 061f1a8ec5
commit e980a26ddd
16 changed files with 121 additions and 92 deletions

View File

@@ -2056,6 +2056,14 @@ namespace Consensus {
error("CheckInputs(): tried to spend coinbase at depth %d", nSpendHeight - coins->nHeight),
REJECT_INVALID, "bad-txns-premature-spend-of-coinbase");
}
// ensure that zeroth output of coinbases are not still time locked
uint64_t unlockTime = tx.UnlockTime(0);
if (nSpendHeight >= unlockTime) {
return state.Invalid(
error("CheckInputs(): tried to spend coinbase that is timelocked until block %d", unlockTime),
REJECT_INVALID, "bad-txns-premature-spend-of-coinbase");
}
// Ensure that coinbases cannot be spent to transparent outputs
// Disabled on regtest