Skip to content

Commit

Permalink
Set default recommendation to null when not enough data is available
Browse files Browse the repository at this point in the history
  • Loading branch information
zilm13 committed Apr 17, 2018
1 parent 95a0ea1 commit a35888e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
public class RecommendedGasPriceTracker extends EthereumListenerAdapter {

private static final long DEFAULT_PRICE = 1_000_000_000L;
private static final Long DEFAULT_PRICE = null;
private static final int MIN_BLOCKS = 128;
private static final int BLOCKS_RECOUNT = 1;
private static final int MIN_TRANSACTIONS = 512;
Expand All @@ -50,7 +50,7 @@ public class RecommendedGasPriceTracker extends EthereumListenerAdapter {
private CircularFifoQueue<Long> blockGasPricesExtra = new CircularFifoQueue<>(getMinTransactions());

private int idx = 0;
private long recommendedGasPrice = getDefaultPrice();
private Long recommendedGasPrice = getDefaultPrice();

public RecommendedGasPriceTracker() {
blockGasPrices = new CircularFifoQueue<>(getMinBlocks());
Expand Down Expand Up @@ -115,7 +115,7 @@ private synchronized Long getGasPrice() {
* Until this {@link #getDefaultPrice()} is returned
* @return recommended gas price for transaction
*/
public long getRecommendedGasPrice() {
public Long getRecommendedGasPrice() {
return recommendedGasPrice;
}

Expand All @@ -137,7 +137,7 @@ public static int getMinBlocks() {
* Used when not enough data gathered
* @return default transaction price
*/
public static long getDefaultPrice() {
public static Long getDefaultPrice() {
return DEFAULT_PRICE;
}

Expand Down

0 comments on commit a35888e

Please sign in to comment.