Make sure coinbase has no fees

This commit is contained in:
Gregory Sanders 2016-12-14 11:25:31 -05:00
parent 796072852d
commit cb2ee26d12

View file

@ -529,10 +529,10 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state, bool fChe
if (tx.IsCoinBase())
{
// Coinbase transactions may not have eccessive scriptSigs
// Coinbase transactions may not have eccessive scriptSigs or any fee outputs
if (tx.vin[0].scriptSig.size() < 2 || tx.vin[0].scriptSig.size() > 100)
return state.DoS(100, false, REJECT_INVALID, "bad-cb-length");
if (tx.GetFee() != 0)
if (tx.HasValidFee() || tx.GetFee() != 0)
return state.DoS(100, false, REJECT_INVALID, "bad-cb-fee");
}
else