Merge pull request #3360 from tyzbit/3357_start-time

rpcserver: startTime defaults to the unix epoch
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2019-10-07 16:48:23 -07:00
commit 2a3538fec8
2 files changed
+6 -7

No files matched your search

+2 -7
View File
@@ -4672,13 +4672,8 @@ func (r *rpcServer) ForwardingHistory(ctx context.Context,
numEvents uint32
)
// If the start time wasn't specified, we'll default to 24 hours ago.
if req.StartTime == 0 {
now := time.Now()
startTime = now.Add(-time.Hour * 24)
} else {
startTime = time.Unix(int64(req.StartTime), 0)
}
// startTime defaults to the Unix epoch (0 unixtime, or midnight 01-01-1970).
startTime = time.Unix(int64(req.StartTime), 0)
// If the end time wasn't specified, assume a default end time of now.
if req.EndTime == 0 {