Skip to content

Commit

Permalink
fixed overflow bug for broadcast transaction offset tick
Browse files Browse the repository at this point in the history
  • Loading branch information
0xluk committed Aug 1, 2024
1 parent fc8a4c2 commit cf20c96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion foundation/rpc_server/rpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (s *Server) BroadcastTransaction(ctx context.Context, req *protobuff.Broadc
return nil, status.Error(codes.Internal, err.Error())
}

offsetTick := transaction.Tick - maxTick
offsetTick := int32(transaction.Tick) - int32(maxTick)
if offsetTick <= 0 {
return nil, status.Errorf(codes.InvalidArgument, "Target tick: %d for the transaction should be greater than max tick: %d", transaction.Tick, maxTick)
}
Expand Down

0 comments on commit cf20c96

Please sign in to comment.