Prevent coinbases from being spent to transparent outputs.

This commit is contained in:
Sean Bowe
2016-06-13 11:58:10 -06:00
parent 2c901fd87d
commit 1d38795f50
2 changed files with 53 additions and 1 deletions

View File

@@ -1629,7 +1629,12 @@ bool NonContextualCheckInputs(const CTransaction& tx, CValidationState &state, c
assert(coins);
if (coins->IsCoinBase()) {
// Ensure that coinbases cannot be spent to transparent outputs
if (!tx.vout.empty()) {
return state.Invalid(
error("CheckInputs(): tried to spend coinbase with transparent outputs"),
REJECT_INVALID, "bad-txns-coinbase-spend-has-transparent-outputs");
}
}
// Check for negative or overflow input values