Skip to content

Commit

Permalink
Improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfredKarrer committed Apr 3, 2019
1 parent 7f2e406 commit 8d22d7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java
Original file line number Diff line number Diff line change
Expand Up @@ -557,16 +557,16 @@ private void addInputsAndChangeOutputForTx(Transaction tx, Coin fee, BsqCoinSele
if (requireChangeOutput) {
checkArgument(change.isPositive(),
"This transaction requires a mandatory BSQ change output. " +
"You are missing " + Restrictions.getMinNonDustOutput().value / 100d +
" BSQ for a non dust change output.");
"At least " + Restrictions.getMinNonDustOutput().add(fee) + " " +
"BSQ is needed for this transaction");
}

if (change.isPositive()) {
checkArgument(Restrictions.isAboveDust(change),
"The change output of " + change.value / 100d + " BSQ is below the min. dust value of "
+ Restrictions.getMinNonDustOutput().value / 100d +
" BSQ. You are missing " + (Restrictions.getMinNonDustOutput().value - change.value) / 100d +
" BSQ for a non dust change output.");
". At least " + Restrictions.getMinNonDustOutput().add(fee) + " " +
"BSQ is needed for this transaction");
tx.addOutput(change, getChangeAddress());
}
} catch (InsufficientMoneyException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ private void publishMyProposal(ProposalType type) {
message = e.getMessage();
}
new Popup<>().warning(message).show();
} catch (IllegalArgumentException e) {
log.error(e.toString());
e.printStackTrace();
new Popup<>().warning(e.getMessage()).show();
} catch (Throwable e) {
log.error(e.toString());
e.printStackTrace();
Expand Down

0 comments on commit 8d22d7b

Please sign in to comment.