OSDN Git Service

Added blockchain struct.
[bytom/bytom.git] / protocol / bc / timerange.go
1 package bc
2
3 import "io"
4
5 // TimeRange denotes a time range. It satisfies the Entry interface.
6
7 func (TimeRange) typ() string { return "timerange1" }
8 func (tr *TimeRange) writeForHash(w io.Writer) {
9         mustWriteForHash(w, tr.MinTimeMs)
10         mustWriteForHash(w, tr.MaxTimeMs)
11         mustWriteForHash(w, tr.ExtHash)
12 }
13
14 // NewTimeRange creates a new TimeRange.
15 func NewTimeRange(minTimeMS, maxTimeMS uint64) *TimeRange {
16         return &TimeRange{
17                 MinTimeMs: minTimeMS,
18                 MaxTimeMs: maxTimeMS,
19         }
20 }