Fix fat finger protection issue

Normally, for currencies that have a market price feed, Bisq provents
the user from entering offers that are more than 50% away from spot.
It recently came to light via a mediation case that this fat finger
protection in Bisq has a flaw.
A certain sequence of focus operations in the enter offer screen
causes fat finger protection to turn off, and then the user is no
longer protected from making offers that are significantly out of
the market.

To reproduce the issue:

Go to BUY (or SELL) BTC for an market priced asset, e.g. ETH
Click Create New Offer
Click the up/down arrow icon to make sure the % from market price
edit box is selected at the top.
Close the dialog, this saves the selected price format.
Click Create New Offer
Enter 0.25 BTC
Tab to the next field.
Click the up/down arrow icon to make sure the fixed price edit box
is selected at the top.  The price and deviation gets auto-populated
to market price and 0% deviation.
Enter a fixed price that is 10x higher than market value.
Click "Next" and the fat finger protection warning DOES NOT pop up.
This is because the deviation still shows 0%.
This commit is contained in:
jmacxx 2021-12-12 19:28:06 -06:00
parent a5922661b4
commit d901faa29e
No known key found for this signature in database
GPG Key ID: 155297BABFE94A1B

View File

@ -812,6 +812,7 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
}
void onFixPriceToggleChange(boolean fixedPriceSelected) {
inputIsMarketBasedPrice = !fixedPriceSelected;
updateButtonDisableState();
if (!fixedPriceSelected) {
onTriggerPriceTextFieldChanged();