Skip to content

Commit

Permalink
Apply new transaction limits
Browse files Browse the repository at this point in the history
  • Loading branch information
psolstice committed Jul 20, 2024
1 parent 6904736 commit fbea637
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4620,8 +4620,8 @@ void CWallet::CheckTransparentTransactionSanity(CMutableTransaction& tx,
const CCoinControl* coinControl, CAmount nFee, bool fSign) {
size_t txSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);

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

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

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

0 comments on commit fbea637

Please sign in to comment.