Skip to content

Commit

Permalink
Increase tx size limit up to 250kb (#1457)
Browse files Browse the repository at this point in the history
* Increase tx size limit up to 250kb

* Error messages updated
  • Loading branch information
levonpetrosyan93 authored Jun 18, 2024
1 parent fc2e876 commit d23d3ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/policy/policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static const unsigned int DEFAULT_BLOCK_MIN_TX_FEE = 1000;
/** The maximum weight for transactions we're willing to relay/mine */
static const unsigned int MAX_STANDARD_TX_WEIGHT = 400000;
/** The new maximum weight for transactions we're willing to relay/mine */
static const unsigned int MAX_NEW_TX_WEIGHT = 520000;
static const unsigned int MAX_NEW_TX_WEIGHT = 1000000;
/** Maximum number of signature check operations in an IsStandard() P2SH script */
static const unsigned int MAX_P2SH_SIGOPS = 15;
/** The maximum number of sigops we're willing to relay/mine in a single tx */
Expand Down
6 changes: 3 additions & 3 deletions src/spark/sparkwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,8 +1023,8 @@ bool CSparkWallet::CreateSparkMintTransactions(

// Limit size
CTransaction txConst(tx);
if (GetTransactionWeight(txConst) >= MAX_STANDARD_TX_WEIGHT) {
strFailReason = _("Transaction is too large (size limit: 100Kb). Select less inputs or consolidate your UTXOs");
if (GetTransactionWeight(txConst) >= MAX_NEW_TX_WEIGHT) {
strFailReason = _("Transaction is too large (size limit: 250Kb). Select less inputs or consolidate your UTXOs");
return false;
}
dPriority = txConst.ComputePriority(dPriority, nBytes);
Expand Down Expand Up @@ -1536,7 +1536,7 @@ CWalletTx CSparkWallet::CreateSparkSpendTransaction(
}

if (GetTransactionWeight(tx) >= MAX_NEW_TX_WEIGHT) {
throw std::runtime_error(_("Transaction is too large (size limit: 100Kb). Select less inputs or consolidate your UTXOs"));
throw std::runtime_error(_("Transaction is too large (size limit: 250Kb). Select less inputs or consolidate your UTXOs"));
}

// check fee
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4564,9 +4564,9 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
nBytes += GetSizeOfCompactSize(nExtraPayloadSize) + nExtraPayloadSize;
}

if (GetTransactionWeight(txNew) >= MAX_STANDARD_TX_WEIGHT) {
if (GetTransactionWeight(txNew) >= MAX_NEW_TX_WEIGHT) {
// Do not create oversized transactions (bad-txns-oversize).
strFailReason = _("Transaction is too large (size limit: 100Kb). Select less inputs or consolidate your UTXOs");
strFailReason = _("Transaction is too large (size limit: 250Kb). Select less inputs or consolidate your UTXOs");
return false;
}

Expand Down

0 comments on commit d23d3ce

Please sign in to comment.