Skip to content

Commit

Permalink
checks
Browse files Browse the repository at this point in the history
  • Loading branch information
securecloudnet committed Dec 21, 2018
1 parent fd380da commit 8185e0e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1863,20 +1863,20 @@ bool CheckInputs(const CTransaction& tx, CValidationState& state, const CCoinsVi
}

if (!tx.IsCoinStake()) {
// 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())),
// REJECT_INVALID, "bad-txns-in-belowout");
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())),
REJECT_INVALID, "bad-txns-in-belowout");

// Tally transaction fees
CAmount nTxFee = nValueIn - tx.GetValueOut();
// if (nTxFee < 0)
// return state.DoS(100, error("CheckInputs() : %s nTxFee < 0", tx.GetHash().ToString()),
// REJECT_INVALID, "bad-txns-fee-negative");
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))
// return state.DoS(100, error("CheckInputs() : nFees out of range"),
// REJECT_INVALID, "bad-txns-fee-outofrange");
if (!MoneyRange(nFees))
return state.DoS(100, error("CheckInputs() : nFees out of range"),
REJECT_INVALID, "bad-txns-fee-outofrange");
}
// The first loop above does all the inexpensive checks.
// Only if ALL inputs pass do we perform expensive ECDSA signature checks.
Expand Down

0 comments on commit 8185e0e

Please sign in to comment.