diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4f966510306ff..b2aa465b5396b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3703,6 +3703,12 @@ bool CWallet::CreateTransaction(const std::vector& vecSend, CWalletT unsigned int nBytes = ::GetSerializeSize(txNew, SER_NETWORK, PROTOCOL_VERSION); + if (nBytes > MAX_STANDARD_TX_SIZE) { + // Do not create oversized transactions (bad-txns-oversize). + strFailReason = _("Transaction too large"); + return false; + } + CTransaction txNewConst(txNew); dPriority = txNewConst.ComputePriority(dPriority, nBytes);