mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Add encrypted wallet password prompt when sending funds from BSQ wallet
Correct wording of transaction confirmation popup to use 'mining fee' instead of 'transaction fee' to make it consistent with wording of the BTC confirmation popup.
This commit is contained in:
parent
0345c795e2
commit
48a515be01
@ -2262,7 +2262,7 @@ dao.wallet.send.setDestinationAddress=Fill in your destination address
|
||||
dao.wallet.send.send=Send BSQ funds
|
||||
dao.wallet.send.sendBtc=Send BTC funds
|
||||
dao.wallet.send.sendFunds.headline=Confirm withdrawal request
|
||||
dao.wallet.send.sendFunds.details=Sending: {0}\nTo receiving address: {1}.\nRequired transaction fee is: {2} ({3} satoshis/byte)\nTransaction size: {4} Kb\n\nThe recipient will receive: {5}\n\nAre you sure you want to withdraw that amount?
|
||||
dao.wallet.send.sendFunds.details=Sending: {0}\nTo receiving address: {1}.\nRequired mining fee is: {2} ({3} satoshis/byte)\nTransaction size: {4} Kb\n\nThe recipient will receive: {5}\n\nAre you sure you want to withdraw that amount?
|
||||
dao.wallet.chainHeightSynced=Latest verified block: {0}
|
||||
dao.wallet.chainHeightSyncing=Awaiting blocks... Verified {0} blocks out of {1}
|
||||
dao.wallet.tx.type=Type
|
||||
|
@ -27,6 +27,7 @@ import bisq.desktop.main.dao.wallet.BsqBalanceUtil;
|
||||
import bisq.desktop.main.funds.FundsView;
|
||||
import bisq.desktop.main.funds.deposit.DepositView;
|
||||
import bisq.desktop.main.overlays.popups.Popup;
|
||||
import bisq.desktop.main.overlays.windows.WalletPasswordWindow;
|
||||
import bisq.desktop.util.GUIUtil;
|
||||
import bisq.desktop.util.Layout;
|
||||
import bisq.desktop.util.validation.BsqAddressValidator;
|
||||
@ -53,6 +54,7 @@ import bisq.core.util.validation.BtcAddressValidator;
|
||||
|
||||
import bisq.network.p2p.P2PService;
|
||||
|
||||
import bisq.common.UserThread;
|
||||
import bisq.common.handlers.ResultHandler;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
@ -67,6 +69,8 @@ import javafx.scene.layout.GridPane;
|
||||
|
||||
import javafx.beans.value.ChangeListener;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static bisq.desktop.util.FormBuilder.addButtonAfterGroup;
|
||||
import static bisq.desktop.util.FormBuilder.addInputTextField;
|
||||
import static bisq.desktop.util.FormBuilder.addTitledGroupBg;
|
||||
@ -86,6 +90,7 @@ public class BsqSendView extends ActivatableView<GridPane, Void> implements BsqB
|
||||
private final BtcValidator btcValidator;
|
||||
private final BsqAddressValidator bsqAddressValidator;
|
||||
private final BtcAddressValidator btcAddressValidator;
|
||||
private final WalletPasswordWindow walletPasswordWindow;
|
||||
|
||||
private int gridRow = 0;
|
||||
private InputTextField amountInputTextField, btcAmountInputTextField;
|
||||
@ -113,7 +118,8 @@ public class BsqSendView extends ActivatableView<GridPane, Void> implements BsqB
|
||||
BsqValidator bsqValidator,
|
||||
BtcValidator btcValidator,
|
||||
BsqAddressValidator bsqAddressValidator,
|
||||
BtcAddressValidator btcAddressValidator) {
|
||||
BtcAddressValidator btcAddressValidator,
|
||||
WalletPasswordWindow walletPasswordWindow) {
|
||||
this.bsqWalletService = bsqWalletService;
|
||||
this.btcWalletService = btcWalletService;
|
||||
this.walletsManager = walletsManager;
|
||||
@ -127,6 +133,7 @@ public class BsqSendView extends ActivatableView<GridPane, Void> implements BsqB
|
||||
this.btcValidator = btcValidator;
|
||||
this.bsqAddressValidator = bsqAddressValidator;
|
||||
this.btcAddressValidator = btcAddressValidator;
|
||||
this.walletPasswordWindow = walletPasswordWindow;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -362,7 +369,7 @@ public class BsqSendView extends ActivatableView<GridPane, Void> implements BsqB
|
||||
amountFormatter.formatCoinWithCode(receiverAmount)))
|
||||
.actionButtonText(Res.get("shared.yes"))
|
||||
.onAction(() -> {
|
||||
walletsManager.publishAndCommitBsqTx(txWithBtcFee, txType, new TxBroadcaster.Callback() {
|
||||
doWithdraw(txWithBtcFee, txType, new TxBroadcaster.Callback() {
|
||||
@Override
|
||||
public void onSuccess(Transaction transaction) {
|
||||
log.debug("Successfully sent tx with id {}", txWithBtcFee.getTxId().toString());
|
||||
@ -378,5 +385,19 @@ public class BsqSendView extends ActivatableView<GridPane, Void> implements BsqB
|
||||
.closeButtonText(Res.get("shared.cancel"))
|
||||
.show();
|
||||
}
|
||||
|
||||
private void doWithdraw(Transaction txWithBtcFee, TxType txType, TxBroadcaster.Callback callback) {
|
||||
if (btcWalletService.isEncrypted()) {
|
||||
UserThread.runAfter(() -> walletPasswordWindow.onAesKey(aesKey ->
|
||||
sendFunds(txWithBtcFee, txType, callback))
|
||||
.show(), 300, TimeUnit.MILLISECONDS);
|
||||
} else {
|
||||
sendFunds(txWithBtcFee, txType, callback);
|
||||
}
|
||||
}
|
||||
|
||||
private void sendFunds(Transaction txWithBtcFee, TxType txType, TxBroadcaster.Callback callback) {
|
||||
walletsManager.publishAndCommitBsqTx(txWithBtcFee, txType, callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user