Ensure sum of valueBalance and all vpub_new's does not exceed MAX_MONEY inside of CheckTransactionWithoutProofVerification.
This commit is contained in:
12
src/main.cpp
12
src/main.cpp
@@ -1223,8 +1223,18 @@ bool CheckTransactionWithoutProofVerification(const CTransaction& tx, CValidatio
|
||||
REJECT_INVALID, "bad-txns-txintotal-toolarge");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Also check for Sapling
|
||||
if (tx.valueBalance >= 0) {
|
||||
// NB: positive valueBalance "adds" money to the transparent value pool, just as inputs do
|
||||
nValueIn += tx.valueBalance;
|
||||
|
||||
if (!MoneyRange(nValueIn)) {
|
||||
return state.DoS(100, error("CheckTransaction(): txin total out of range"),
|
||||
REJECT_INVALID, "bad-txns-txintotal-toolarge");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check for duplicate inputs
|
||||
set<COutPoint> vInOutPoints;
|
||||
|
||||
Reference in New Issue
Block a user