Remove requestTxFee method with empty handler

This commit is contained in:
Manfred Karrer 2019-02-12 07:43:02 -05:00
parent a4b39135f8
commit fdafb1cc3a
No known key found for this signature in database
GPG key ID: 401250966A6B2C46

View file

@ -83,6 +83,8 @@ import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import javax.annotation.Nullable;
import static com.google.common.base.Preconditions.checkNotNull;
public abstract class MutableOfferDataModel extends OfferDataModel implements BsqBalanceListener {
@ -280,7 +282,7 @@ public abstract class MutableOfferDataModel extends OfferDataModel implements Bs
priceFeedService.setCurrencyCode(tradeCurrencyCode.get());
// We request to get the actual estimated fee
requestTxFee();
requestTxFee(null);
// Set the default values (in rare cases if the fee request was not done yet we get the hard coded default values)
// But offer creation happens usually after that so we should have already the value from the estimation service.
@ -501,15 +503,11 @@ public abstract class MutableOfferDataModel extends OfferDataModel implements Bs
this.marketPriceMargin = marketPriceMargin;
}
void requestTxFee() {
requestTxFee(() -> {
});
}
void requestTxFee(Runnable actionHandler) {
void requestTxFee(@Nullable Runnable actionHandler) {
feeService.requestFees(() -> {
txFeeFromFeeService = feeService.getTxFee(feeTxSize);
calculateTotalToPay();
if (actionHandler != null)
actionHandler.run();
});
}