Skip to content

Commit

Permalink
No migration window before spark, and more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
levonpetrosyan93 committed Nov 23, 2023
1 parent 117b128 commit eb0a7c9
Showing 1 changed file with 16 additions and 9 deletions.
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

0 comments on commit eb0a7c9

Please sign in to comment.