Skip to content

Commit 0de79d7

Browse files
authored
Do not create oversized transactions (bad-txns-oversize) (#2103)
1 parent fcac40a commit 0de79d7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/wallet/wallet.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3703,6 +3703,12 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
37033703

37043704
unsigned int nBytes = ::GetSerializeSize(txNew, SER_NETWORK, PROTOCOL_VERSION);
37053705

3706+
if (nBytes > MAX_STANDARD_TX_SIZE) {
3707+
// Do not create oversized transactions (bad-txns-oversize).
3708+
strFailReason = _("Transaction too large");
3709+
return false;
3710+
}
3711+
37063712
CTransaction txNewConst(txNew);
37073713
dPriority = txNewConst.ComputePriority(dPriority, nBytes);
37083714

0 commit comments

Comments
 (0)