use of bisq.common.handlers.FaultHandler in project bisq-desktop by bisq-network.
the class BuyerStep4View method doWithdrawal.
private void doWithdrawal(Coin amount, Coin fee) {
String toAddress = withdrawAddressTextField.getText();
ResultHandler resultHandler = this::handleTradeCompleted;
FaultHandler faultHandler = (errorMessage, throwable) -> {
useSavingsWalletButton.setDisable(false);
withdrawToExternalWalletButton.setDisable(false);
if (throwable != null && throwable.getMessage() != null)
new Popup<>().error(errorMessage + "\n\n" + throwable.getMessage()).show();
else
new Popup<>().error(errorMessage).show();
};
if (model.dataModel.btcWalletService.isEncrypted()) {
UserThread.runAfter(() -> model.dataModel.walletPasswordWindow.onAesKey(aesKey -> doWithdrawRequest(toAddress, amount, fee, aesKey, resultHandler, faultHandler)).show(), 300, TimeUnit.MILLISECONDS);
} else
doWithdrawRequest(toAddress, amount, fee, null, resultHandler, faultHandler);
}
Aggregations