diff --git a/core/src/main/java/io/bitsquare/btc/WalletService.java b/core/src/main/java/io/bitsquare/btc/WalletService.java index 247a90ae4b..70454e62a3 100644 --- a/core/src/main/java/io/bitsquare/btc/WalletService.java +++ b/core/src/main/java/io/bitsquare/btc/WalletService.java @@ -440,10 +440,11 @@ public class WalletService { public Coin getRequiredFee(String fromAddress, String toAddress, - Coin amount) throws AddressFormatException, IllegalArgumentException, InsufficientMoneyException { + Coin amount, + KeyParameter aesKey) throws AddressFormatException, IllegalArgumentException, InsufficientMoneyException { Coin fee; try { - wallet.completeTx(getSendRequest(fromAddress, toAddress, amount, null)); + wallet.completeTx(getSendRequest(fromAddress, toAddress, amount, aesKey)); fee = Coin.ZERO; } catch (InsufficientMoneyException e) { log.info("The amount to be transferred is not enough to pay the transaction fees of {}. " + @@ -480,7 +481,7 @@ public class WalletService { Coin amount, KeyParameter aesKey, FutureCallback callback) throws AddressFormatException, IllegalArgumentException, InsufficientMoneyException { - Coin fee = getRequiredFee(fromAddress, toAddress, amount); + Coin fee = getRequiredFee(fromAddress, toAddress, amount, aesKey); Wallet.SendResult sendResult = wallet.sendCoins(getSendRequest(fromAddress, toAddress, amount.subtract(fee), aesKey)); Futures.addCallback(sendResult.broadcastComplete, callback); diff --git a/gui/src/main/java/io/bitsquare/gui/main/funds/withdrawal/WithdrawalView.java b/gui/src/main/java/io/bitsquare/gui/main/funds/withdrawal/WithdrawalView.java index 6e7a9379d9..3b033094e2 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/funds/withdrawal/WithdrawalView.java +++ b/gui/src/main/java/io/bitsquare/gui/main/funds/withdrawal/WithdrawalView.java @@ -191,7 +191,7 @@ public class WithdrawalView extends ActivatableView { }; try { Coin requiredFee = walletService.getRequiredFee(withdrawFromTextField.getText(), - withdrawToTextField.getText(), senderAmount); + withdrawToTextField.getText(), senderAmount, null); Coin receiverAmount = senderAmount.subtract(requiredFee); if (BitsquareApp.DEV_MODE) { doWithdraw(receiverAmount, callback);