diff --git a/pkg/rpc/server/server.go b/pkg/rpc/server/server.go index 00335af5e..5a215cdf9 100644 --- a/pkg/rpc/server/server.go +++ b/pkg/rpc/server/server.go @@ -516,10 +516,17 @@ func (s *Server) getUTXOTransfers(ps request.Params) (interface{}, *response.Err index++ } - start, end, err := getTimestamps(ps.Value(index), ps.Value(index+1)) + p1, p2 := ps.Value(index), ps.Value(index+1) + start, end, err := getTimestamps(p1, p2) if err != nil { return nil, response.NewInvalidParamsError("", err) } + if p2 == nil { + end = uint32(time.Now().Unix()) + if p1 == nil { + start = uint32(time.Now().Add(-time.Hour * 24 * 7).Unix()) + } + } sent, recv, err := getAssetMaps(assetName) if err != nil { diff --git a/pkg/rpc/server/server_test.go b/pkg/rpc/server/server_test.go index bfec2bc7a..64ce7d6b3 100644 --- a/pkg/rpc/server/server_test.go +++ b/pkg/rpc/server/server_test.go @@ -1138,7 +1138,7 @@ func testRPCProtocol(t *testing.T, doRPCCall func(string, string, *testing.T) [] if asset != "" { ps = append(ps, fmt.Sprintf("%q", asset)) } - if start != 0 { + if start >= 0 { if start > int(e.chain.HeaderHeight()) { ps = append(ps, strconv.Itoa(int(time.Now().Unix()))) } else {