Added value balance consensus enforcement for pours.

This commit is contained in:
Sean Bowe
2016-01-04 06:02:01 -07:00
parent 45d6bee945
commit f512cf7c7b
4 changed files with 34 additions and 0 deletions

View File

@@ -1533,6 +1533,11 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
}
nValueIn += tx.GetPourValueIn();
if (!MoneyRange(nValueIn))
return state.DoS(100, error("CheckInputs(): vpub_old values out of range"),
REJECT_INVALID, "bad-txns-inputvalues-outofrange");
if (nValueIn < tx.GetValueOut())
return state.DoS(100, error("CheckInputs(): %s value in (%s) < value out (%s)",
tx.GetHash().ToString(), FormatMoney(nValueIn), FormatMoney(tx.GetValueOut())),