Test
This commit is contained in:
@@ -2013,17 +2013,16 @@ bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoins
|
|||||||
if (nValueIn < tx.GetValueOut())
|
if (nValueIn < tx.GetValueOut())
|
||||||
{
|
{
|
||||||
fprintf(stderr,"spentheight.%d valuein %s vs %s error\n",nSpendHeight,FormatMoney(nValueIn).c_str(), FormatMoney(tx.GetValueOut()).c_str());
|
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");
|
tx.GetHash().ToString(), FormatMoney(nValueIn), FormatMoney(tx.GetValueOut()),((double)nValueIn - tx.GetValueOut())/COIN),REJECT_INVALID, "bad-txns-in-belowout");
|
||||||
}
|
}
|
||||||
// Tally transaction fees
|
// Tally transaction fees
|
||||||
CAmount nTxFee = nValueIn - tx.GetValueOut();
|
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()),
|
return state.DoS(100, error("CheckInputs(): %s nTxFee < 0", tx.GetHash().ToString()),
|
||||||
REJECT_INVALID, "bad-txns-fee-negative");
|
REJECT_INVALID, "bad-txns-fee-negative");
|
||||||
nFees += nTxFee;
|
nFees += nTxFee;
|
||||||
if (!MoneyRange(nFees) && nSpendHeight > 300000 )
|
if (!MoneyRange(nFees))
|
||||||
return state.DoS(100, error("CheckInputs(): nFees out of range"),
|
return state.DoS(100, error("CheckInputs(): nFees out of range"),
|
||||||
REJECT_INVALID, "bad-txns-fee-outofrange");
|
REJECT_INVALID, "bad-txns-fee-outofrange");
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user