Skip to content

Commit

Permalink
fix(stableMinGasPrice): apply naming suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Vovchyk committed Sep 19, 2024
1 parent 1265ac9 commit 8cecf43
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public Coin getMinGasPriceAsCoin() {
}

@VisibleForTesting
public Coin getMinGasPriceAsCoin(boolean wait) {
Coin getMinGasPriceAsCoin(boolean wait) {
return Coin.valueOf(getMinGasPrice(wait));
}

Expand All @@ -102,9 +102,9 @@ private long calculateMinGasPriceBasedOnBtcPrice(long btcValue) {
}

private synchronized Future<Long> fetchPriceAsync() {
Future<Long> curFuture = priceFuture.get();
if (curFuture != null) {
return curFuture;
Future<Long> future = priceFuture.get();
if (future != null) {
return future;
}

CompletableFuture<Long> newFuture = new CompletableFuture<>();
Expand All @@ -129,11 +129,11 @@ private Optional<Long> fetchPriceSync() {
return Optional.of(result);
}

int curNumOfFailures = numOfFailures.incrementAndGet();
if (curNumOfFailures >= ERR_NUM_OF_FAILURES) {
logger.error("Gas price was not updated as it was not possible to obtain valid price from provider. Check your provider setup. Number of failed attempts: {}", curNumOfFailures);
int failedAttempts = numOfFailures.incrementAndGet();
if (failedAttempts >= ERR_NUM_OF_FAILURES) {
logger.error("Gas price was not updated as it was not possible to obtain valid price from provider. Check your provider setup. Number of failed attempts: {}", failedAttempts);
} else {
logger.warn("Gas price was not updated as it was not possible to obtain valid price from provider. Number of failed attempts: {}", curNumOfFailures);
logger.warn("Gas price was not updated as it was not possible to obtain valid price from provider. Number of failed attempts: {}", failedAttempts);
}

return Optional.empty();
Expand Down

0 comments on commit 8cecf43

Please sign in to comment.