File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ var errElapsedHeight = errors.New("elapsed height")
16
16
type heightSub [H header.Header ] struct {
17
17
// height refers to the latest locally available header height
18
18
// that has been fully verified and inserted into the subjective chain
19
- height uint64 // atomic
19
+ height atomic. Uint64
20
20
heightReqsLk sync.Mutex
21
21
heightReqs map [uint64 ][]chan H
22
22
}
@@ -30,12 +30,12 @@ func newHeightSub[H header.Header]() *heightSub[H] {
30
30
31
31
// Height reports current height.
32
32
func (hs * heightSub [H ]) Height () uint64 {
33
- return atomic . LoadUint64 ( & hs .height )
33
+ return hs .height . Load ( )
34
34
}
35
35
36
36
// SetHeight sets the new head height for heightSub.
37
37
func (hs * heightSub [H ]) SetHeight (height uint64 ) {
38
- atomic . StoreUint64 ( & hs .height , height )
38
+ hs .height . Store ( height )
39
39
}
40
40
41
41
// Sub subscribes for a header of a given height.
You can’t perform that action at this time.
0 commit comments