diff --git a/api/coreservice.go b/api/coreservice.go index 3fbfd3ad85..d83bf4f79d 100644 --- a/api/coreservice.go +++ b/api/coreservice.go @@ -1318,10 +1318,9 @@ func (core *coreService) reverseActionsInBlock(blk *block.Block, reverseStart, c if reverseStart > size || count == 0 { return nil } - // TODO (saito): fix overflow - start := size - (reverseStart + count) - if start < 0 { - start = 0 + start := uint64(0) + if size > reverseStart+count { + start = size - (reverseStart + count) } end := size - 1 - reverseStart res := make([]*iotexapi.ActionInfo, 0, start-end+1)