Skip to content

Commit fbea637

Browse files
committed
Apply new transaction limits
1 parent 6904736 commit fbea637

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4620,8 +4620,8 @@ void CWallet::CheckTransparentTransactionSanity(CMutableTransaction& tx,
46204620
const CCoinControl* coinControl, CAmount nFee, bool fSign) {
46214621
size_t txSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
46224622

4623-
if (txSize * WITNESS_SCALE_FACTOR > MAX_STANDARD_TX_WEIGHT)
4624-
throw std::runtime_error("Transaction too large");
4623+
if (txSize * WITNESS_SCALE_FACTOR > MAX_NEW_TX_WEIGHT)
4624+
throw std::runtime_error("Transaction is too large (size limit: 250Kb). Select less inputs or consolidate your UTXOs");
46254625

46264626
if (coinControl && coinControl->nMaxSize && txSize > coinControl->nMaxSize)
46274627
throw std::runtime_error("We made a transaction exceeding coinControl->nMaxSize. This is a bug.");
@@ -4800,7 +4800,7 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
48004800

48014801
CAmount nChangeAmount = nCollected - nRequired - (nRecipientsToSplitFee ? 0 : nFeeRet);
48024802
// If the collected amount is exactly what is required, we don't need to make a change output.
4803-
if (nChangeAmount || (coinControl && coinControl->fNoChange)) {
4803+
if (nChangeAmount && !(coinControl && coinControl->fNoChange)) {
48044804
CScript scriptChange;
48054805
if (coinControl && coinControl->destChange.which() != 0) {
48064806
scriptChange = GetScriptForDestination(coinControl->destChange);

0 commit comments

Comments
 (0)