mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-19 20:34:30 -04:00
Fix bug with dust warning
This commit is contained in:
parent
cff4db450c
commit
23f92db561
1 changed files with 8 additions and 7 deletions
|
@ -290,14 +290,15 @@ class TakeOfferDataModel extends ActivatableDataModel {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isAmountLargerThanOfferAmountMinusFee() {
|
boolean wouldCreateDustForOfferer() {
|
||||||
//noinspection SimplifiableIfStatement
|
//noinspection SimplifiableIfStatement
|
||||||
if (amountAsCoin.get() != null && offer != null)
|
if (amountAsCoin.get() != null && offer != null) {
|
||||||
return amountAsCoin.get()
|
Coin customAmount = offer.getAmount().subtract(amountAsCoin.get());
|
||||||
.add(FeePolicy.getFeePerKb())
|
Coin dustAndFee = FeePolicy.getFeePerKb().add(Transaction.MIN_NONDUST_OUTPUT);
|
||||||
.add(Transaction.MIN_NONDUST_OUTPUT)
|
return customAmount.isPositive() && customAmount.isLessThan(dustAndFee);
|
||||||
.isGreaterThan(offer.getAmount());
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public PaymentMethod getPaymentMethod() {
|
public PaymentMethod getPaymentMethod() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue