mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-19 15:26:03 -04:00
Fix bug with dust warning
This commit is contained in:
parent
cff4db450c
commit
23f92db561
@ -290,14 +290,15 @@ class TakeOfferDataModel extends ActivatableDataModel {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean isAmountLargerThanOfferAmountMinusFee() {
|
||||
boolean wouldCreateDustForOfferer() {
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (amountAsCoin.get() != null && offer != null)
|
||||
return amountAsCoin.get()
|
||||
.add(FeePolicy.getFeePerKb())
|
||||
.add(Transaction.MIN_NONDUST_OUTPUT)
|
||||
.isGreaterThan(offer.getAmount());
|
||||
return true;
|
||||
if (amountAsCoin.get() != null && offer != null) {
|
||||
Coin customAmount = offer.getAmount().subtract(amountAsCoin.get());
|
||||
Coin dustAndFee = FeePolicy.getFeePerKb().add(Transaction.MIN_NONDUST_OUTPUT);
|
||||
return customAmount.isPositive() && customAmount.isLessThan(dustAndFee);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public PaymentMethod getPaymentMethod() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user