Skip to content

Commit 4cffa0e

Browse files
UdjinM6Yoyae
authored andcommitted
Do not create oversized transactions (bad-txns-oversize) (dashpay#2103)
1 parent 6d8b594 commit 4cffa0e

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
@@ -3704,6 +3704,12 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
37043704

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

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

0 commit comments

Comments
 (0)