Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit f761be5

Browse files
committed
Make RecommendedGasPriceTracker settings configurable and easy to use for replay
1 parent 605e8ac commit f761be5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ethereumj-core/src/main/java/org/ethereum/listener/RecommendedGasPriceTracker.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void onBlock(BlockSummary blockSummary) {
5656
onBlock(blockSummary.getBlock());
5757
}
5858

59-
private void onBlock(Block block) {
59+
protected void onBlock(Block block) {
6060
if (onTransactions(block.getTransactionsList())) {
6161
++idx;
6262
if (idx >= getBlocksRecount()) {
@@ -126,7 +126,7 @@ public Long getRecommendedGasPrice() {
126126
* data for blocks before last {@link #getMinBlocks()} is used when available
127127
* @return minimum number of blocks
128128
*/
129-
public static int getMinBlocks() {
129+
public int getMinBlocks() {
130130
return MIN_BLOCKS;
131131
}
132132

@@ -136,7 +136,7 @@ public static int getMinBlocks() {
136136
* Used when not enough data gathered
137137
* @return default transaction price
138138
*/
139-
public static Long getDefaultPrice() {
139+
public Long getDefaultPrice() {
140140
return DEFAULT_PRICE;
141141
}
142142

@@ -146,7 +146,7 @@ public static Long getDefaultPrice() {
146146
* Recount every N blocks
147147
* @return number of blocks
148148
*/
149-
public static int getBlocksRecount() {
149+
public int getBlocksRecount() {
150150
return BLOCKS_RECOUNT;
151151
}
152152

@@ -157,7 +157,7 @@ public static int getBlocksRecount() {
157157
* to override default value on recount
158158
* @return minimum number of transactions for calculation
159159
*/
160-
public static int getMinTransactions() {
160+
public int getMinTransactions() {
161161
return MIN_TRANSACTIONS;
162162
}
163163

@@ -168,7 +168,7 @@ public static int getMinTransactions() {
168168
* So 4 means lowest 25%, 8 lowest 12.5% etc
169169
* @return percentile share
170170
*/
171-
public static int getPercentileShare() {
171+
public int getPercentileShare() {
172172
return PERCENTILE_SHARE;
173173
}
174174
}

0 commit comments

Comments
 (0)