Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable spark tx creation when spork is active #1406

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading