[bisq-network/bisq] [BUGFIX] Account validation comparing user trade limit with MAX amount of offer (#3625)

Pac notifications at github.com
Sun Nov 17 22:47:20 UTC 2019


Fixes issues #3601 and #3537.
The bug only happens when the offer has MIN-MAX value range.
The new `isAmountValidForOffer` in `PaymentAccountUtil.java` considers the MAX amount of the offer, but the button to take it is ungrayed considering the MIN amount, which causes the bug.
For example, if a user has a trade limit of 0.01BTC and an offer has a range of 0.005BTC to 0.1BTC, this user might want to accept it up to his limit, and the button will be available to him.
But the bug will kick in, which freezes any other offer taking until Bisq is restarted.
After getting to next screen, other methods of preventing the user to go above his limit are already implemented in `TakeOfferDataModel.java`, like:

```
void initWithData(Offer offer) {
        [...]
        this.amount.set(Coin.valueOf(Math.min(offer.getAmount().value, getMaxTradeLimit())));
```

```
public void onPaymentAccountSelected(PaymentAccount paymentAccount) {
        [...]
        this.amount.set(Coin.valueOf(Math.max(offer.getMinAmount().value, Math.min(amount.get().value, myLimit))));
```


```
void applyAmount(Coin amount) {
        this.amount.set(Coin.valueOf(Math.min(amount.value, getMaxTradeLimit())));
```
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/3625

-- Commit Summary --

  * [BUGFIX] Account validation was comparing user trade limit with MAX amount of offer

-- File Changes --

    M core/src/main/java/bisq/core/payment/PaymentAccountUtil.java (2)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/3625.patch
https://github.com/bisq-network/bisq/pull/3625.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/3625
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191117/ce476b15/attachment.html>


More information about the bisq-github mailing list