Skip to content

Commit fa4d02d

Browse files
committed
zero block rewards in traces
1 parent 3985343 commit fa4d02d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

turbo/jsonrpc/trace_filtering.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,21 @@ func (api *TraceAPIImpl) Block(ctx context.Context, blockNr rpc.BlockNumber, gas
219219
out = append(out, tr)
220220
}
221221

222+
if len(rewards) == 0 {
223+
var tr ParityTrace
224+
var rewardAction = &RewardTraceAction{}
225+
rewardAction.Author = block.Coinbase()
226+
rewardAction.RewardType = "block" // nolint: goconst
227+
tr.Action = rewardAction
228+
tr.BlockHash = &common.Hash{}
229+
copy(tr.BlockHash[:], block.Hash().Bytes())
230+
tr.BlockNumber = new(uint64)
231+
*tr.BlockNumber = block.NumberU64()
232+
tr.Type = "reward" // nolint: goconst
233+
tr.TraceAddress = []int{}
234+
out = append(out, tr)
235+
}
236+
222237
return out, err
223238
}
224239

0 commit comments

Comments
 (0)