Skip to content

Commit

Permalink
Disable spark tx creation when spork is active (#1406)
Browse files Browse the repository at this point in the history
  • Loading branch information
levonpetrosyan93 committed Jan 28, 2024
1 parent 07c6e12 commit 285a58e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/spark/sparkwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,14 @@ bool CSparkWallet::CreateSparkMintTransactions(
nIn++;
}

{
CValidationState state;
if (!mempool.IsTransactionAllowed(*wtx.tx, state)) {
strFailReason = _("Signing transaction failed");
return false;
}
}

wtx.SetTx(MakeTransactionRef(std::move(tx)));

wtxAndFee.push_back(std::make_pair(wtx, nFeeRet));
Expand Down Expand Up @@ -1548,7 +1556,13 @@ CWalletTx CSparkWallet::CreateSparkSpendTransaction(
result.push_back(wtxNew);
}
}

{
CValidationState state;
for (CWalletTx& wtx : result) {
if (!mempool.IsTransactionAllowed(*wtx.tx, state))
throw std::invalid_argument(_("Spark transactions are disabled at the moment"));
}
}
if (GetBoolArg("-walletrejectlongchains", DEFAULT_WALLET_REJECT_LONG_CHAINS)) {
// Lastly, ensure this tx will pass the mempool's chain limits
size_t nLimitAncestors = GetArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT);
Expand Down

0 comments on commit 285a58e

Please sign in to comment.