Call CheckTransaction as a sanity check on newly created transactions.
This commit is contained in:
parent
dd4263abc8
commit
a753b740e0
@ -1,5 +1,6 @@
|
||||
#include <wallet/txassembler.h>
|
||||
|
||||
#include <consensus/tx_check.h>
|
||||
#include <consensus/validation.h>
|
||||
#include <policy/policy.h>
|
||||
#include <util/check.h>
|
||||
@ -58,6 +59,11 @@ AssembledTx TxAssembler::CreateTransaction(
|
||||
throw CreateTxError(_("Transaction too large"));
|
||||
}
|
||||
|
||||
TxValidationState validation_state;
|
||||
if (!CheckTransaction(*tx, validation_state)) {
|
||||
throw CreateTxError(_("Transaction is invalid"));
|
||||
}
|
||||
|
||||
if (new_tx.total_fee > m_wallet.m_default_max_tx_fee) {
|
||||
throw CreateTxError(TransactionErrorString(TransactionError::MAX_FEE_EXCEEDED));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user