From 59b06e4a0328b8a2ca5839b1a2646725e447be4b Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Wed, 13 Nov 2024 09:30:55 +0800 Subject: [PATCH] eth/gasprice: reduce default gas price for empty block --- eth/gasprice/gasprice.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index 3395965da6..900455fa71 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -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