@@ -537,8 +537,11 @@ func delegateIssuance(tx kv.Tx, block *types.Block, chainConfig *chain.Config, e
537537 return ret , nil
538538}
539539
540- func delegateBlockFees (ctx context.Context , tx kv.Tx , block * types.Block , senders []common.Address , chainConfig * chain.Config , receipts types.Receipts ) (uint64 , error ) {
541- fees := uint64 (0 )
540+ func delegateBlockFees (ctx context.Context , tx kv.Tx , block * types.Block , senders []common.Address , chainConfig * chain.Config , receipts types.Receipts ) (* big.Int , error ) {
541+ fee := big .NewInt (0 )
542+ gasUsed := big .NewInt (0 )
543+
544+ totalFees := big .NewInt (0 )
542545 for _ , receipt := range receipts {
543546 txn := block .Transactions ()[receipt .TransactionIndex ]
544547 effectiveGasPrice := uint64 (0 )
@@ -549,10 +552,15 @@ func delegateBlockFees(ctx context.Context, tx kv.Tx, block *types.Block, sender
549552 gasPrice := new (big.Int ).Add (block .BaseFee (), txn .GetEffectiveGasTip (baseFee ).ToBig ())
550553 effectiveGasPrice = gasPrice .Uint64 ()
551554 }
552- fees += effectiveGasPrice * receipt .GasUsed
555+
556+ fee .SetUint64 (effectiveGasPrice )
557+ gasUsed .SetUint64 (receipt .GasUsed )
558+ fee .Mul (fee , gasUsed )
559+
560+ totalFees .Add (totalFees , fee )
553561 }
554562
555- return fees , nil
563+ return totalFees , nil
556564}
557565
558566func (api * OtterscanAPIImpl ) getBlockWithSenders (ctx context.Context , number rpc.BlockNumber , tx kv.Tx ) (* types.Block , []common.Address , error ) {
0 commit comments