eth/gasprice: reduce default gas price for empty block

This commit is contained in:
Daniel Liu 2024-11-13 09:30:55 +08:00
parent de7203ac88
commit 59b06e4a03

View file

@ -193,9 +193,9 @@ func (oracle *Oracle) SuggestTipCap(ctx context.Context) (*big.Int, error) {
// Nothing returned. There are two special cases here:
// - The block is empty
// - All the transactions included are sent by the miner itself.
// In these cases, use the latest calculated price for samping.
// In these cases, use half of the latest calculated price for samping.
if len(res.values) == 0 {
res.values = []*big.Int{lastPrice}
res.values = []*big.Int{new(big.Int).Div(lastPrice, common.Big2)}
}
// Besides, in order to collect enough data for sampling, if nothing
// meaningful returned, try to query more blocks. But the maximum