fix: embed hcEvents into events as pointer so as not to copy lock

This commit is contained in:
Dirk McCormick 2020-06-26 15:42:44 -04:00
parent bbb9a9cd1a
commit 659c723ea3

View File

@ -51,7 +51,7 @@ type Events struct {
readyOnce sync.Once
heightEvents
hcEvents
*hcEvents
}
func NewEvents(ctx context.Context, api eventAPI) *Events {
@ -74,7 +74,7 @@ func NewEvents(ctx context.Context, api eventAPI) *Events {
htHeights: map[abi.ChainEpoch][]uint64{},
},
hcEvents: *newHCEvents(ctx, api, tsc, uint64(gcConfidence)),
hcEvents: newHCEvents(ctx, api, tsc, uint64(gcConfidence)),
}
e.ready.Add(1)