Skip to content

Commit e8706c0

Browse files
committed
eth/gasprice: reduce default gas price for empty block
1 parent 0479410 commit e8706c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eth/gasprice/gasprice.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ func (gpo *Oracle) SuggestPrice(ctx context.Context) (*big.Int, error) {
148148
// Nothing returned. There are two special cases here:
149149
// - The block is empty
150150
// - All the transactions included are sent by the miner itself.
151-
// In these cases, use the latest calculated price for samping.
151+
// In these cases, use half of the latest calculated price for samping.
152152
if len(res.prices) == 0 {
153-
res.prices = []*big.Int{lastPrice}
153+
res.prices = []*big.Int{new(big.Int).Div(lastPrice, common.Big2)}
154154
}
155155
// Besides, in order to collect enough data for sampling, if nothing
156156
// meaningful returned, try to query more blocks. But the maximum

0 commit comments

Comments
 (0)