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

No migration window before spark, and more fixes #1363

Merged
merged 1 commit into from
Nov 23, 2023
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
25 changes: 16 additions & 9 deletions src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ void SendCoinsDialog::on_sendButton_clicked()
CAmount mintSparkAmount = 0;
CAmount txFee = 0;
CAmount totalAmount = 0;
if (model->getLelantusModel()->getPrivateBalance().first > 0 && chainActive.Height() < ::Params().GetConsensus().nLelantusGracefulPeriod) {
if (model->getLelantusModel()->getPrivateBalance().first > 0 && spark::IsSparkAllowed() && chainActive.Height() < ::Params().GetConsensus().nLelantusGracefulPeriod) {
MigrateLelantusToSparkDialog migrateLelantusToSpark(model);
bool clickedButton = migrateLelantusToSpark.getClickedButton();
if(clickedButton) {
Expand All @@ -332,16 +332,23 @@ void SendCoinsDialog::on_sendButton_clicked()
prepareStatus = model->prepareJoinSplitTransaction(currentTransaction, &ctrl);
} else if ((fAnonymousMode == true) && spark::IsSparkAllowed()) {
prepareStatus = model->prepareSpendSparkTransaction(currentTransaction, &ctrl);
} else if ((fAnonymousMode == false) && (recipients.size() == sparkAddressCount) && spark::IsSparkAllowed()) {
prepareStatus = model->prepareMintSparkTransaction(transactions, recipients, wtxAndFees, reservekeys, &ctrl);
} else if ((fAnonymousMode == false) && (sparkAddressCount == 0)){
SendGoPrivateDialog goPrivateDialog;
bool clickedButton = goPrivateDialog.getClickedButton();
if(clickedButton) {
setAnonymizeMode(true);
fNewRecipientAllowed = true;
} else if ((fAnonymousMode == false) && (recipients.size() == sparkAddressCount)) {
if (spark::IsSparkAllowed())
prepareStatus = model->prepareMintSparkTransaction(transactions, recipients, wtxAndFees, reservekeys, &ctrl);
else {
processSendCoinsReturn(WalletModel::InvalidAddress);
return;
}
} else if ((fAnonymousMode == false) && (sparkAddressCount == 0)) {
if (spark::IsSparkAllowed()) {
SendGoPrivateDialog goPrivateDialog;
bool clickedButton = goPrivateDialog.getClickedButton();
if (clickedButton) {
setAnonymizeMode(true);
fNewRecipientAllowed = true;
return;
}
}
prepareStatus = model->prepareTransaction(currentTransaction, &ctrl);
} else {
fNewRecipientAllowed = true;
Expand Down
Loading