Prevent updating of amount

This commit is contained in:
Christoph Atteneder 2018-04-26 10:22:15 +02:00
parent 8b9ccfe588
commit 5276671f1e
No known key found for this signature in database
GPG Key ID: CD5DC1C529CDFD3B
2 changed files with 5 additions and 1 deletions

View File

@ -134,6 +134,7 @@ public abstract class EditableOfferDataModel extends OfferDataModel implements B
private boolean marketPriceAvailable;
private int feeTxSize = 260; // size of typical tx with 1 input
private int feeTxSizeEstimationRecursionCounter;
protected boolean allowAmountUpdate = true;
///////////////////////////////////////////////////////////////////////////////////////////
// Constructor, lifecycle
@ -652,7 +653,8 @@ public abstract class EditableOfferDataModel extends OfferDataModel implements B
if (volume.get() != null &&
price.get() != null &&
!volume.get().isZero() &&
!price.get().isZero()) {
!price.get().isZero() &&
allowAmountUpdate) {
try {
amount.set(formatter.reduceTo4Decimals(price.get().getAmountByVolume(volume.get())));
calculateTotalToPay();

View File

@ -57,6 +57,8 @@ class EditOpenOfferDataModel extends EditableOfferDataModel {
this.openOffer = openOffer;
this.initialState = openOffer.getState();
this.paymentAccount = user.getPaymentAccount(openOffer.getOffer().getMakerPaymentAccountId());
this.allowAmountUpdate = false;
}
public void populateData() {