This commit is contained in:
jl777
2018-03-26 16:23:01 +03:00
parent f03351d46f
commit 2c0218f0ab

View File

@@ -2013,17 +2013,16 @@ bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoins
if (nValueIn < tx.GetValueOut())
{
fprintf(stderr,"spentheight.%d valuein %s vs %s error\n",nSpendHeight,FormatMoney(nValueIn).c_str(), FormatMoney(tx.GetValueOut()).c_str());
if ( nSpendHeight > 300000 )
return state.DoS(100, error("CheckInputs(): %s value in (%s) < value out (%s) diff %.8f",
return state.DoS(100, error("CheckInputs(): %s value in (%s) < value out (%s) diff %.8f",
tx.GetHash().ToString(), FormatMoney(nValueIn), FormatMoney(tx.GetValueOut()),((double)nValueIn - tx.GetValueOut())/COIN),REJECT_INVALID, "bad-txns-in-belowout");
}
// Tally transaction fees
CAmount nTxFee = nValueIn - tx.GetValueOut();
if (nTxFee < 0 && nSpendHeight > 300000 )
if (nTxFee < 0)
return state.DoS(100, error("CheckInputs(): %s nTxFee < 0", tx.GetHash().ToString()),
REJECT_INVALID, "bad-txns-fee-negative");
nFees += nTxFee;
if (!MoneyRange(nFees) && nSpendHeight > 300000 )
if (!MoneyRange(nFees))
return state.DoS(100, error("CheckInputs(): nFees out of range"),
REJECT_INVALID, "bad-txns-fee-outofrange");
return true;