minor refactor to anonymize interface.
This commit is contained in:
parent
28efa9357c
commit
9912212949
@ -84,21 +84,24 @@ func NewWindowedPoStScheduler(api fullNodeFilteredAPI,
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type changeHandlerAPIImpl struct {
|
|
||||||
fullNodeFilteredAPI
|
|
||||||
*WindowPoStScheduler
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *WindowPoStScheduler) Run(ctx context.Context) {
|
func (s *WindowPoStScheduler) Run(ctx context.Context) {
|
||||||
// Initialize change handler
|
// Initialize change handler.
|
||||||
chImpl := &changeHandlerAPIImpl{fullNodeFilteredAPI: s.api, WindowPoStScheduler: s}
|
|
||||||
s.ch = newChangeHandler(chImpl, s.actor)
|
// callbacks is a union of the fullNodeFilteredAPI and ourselves.
|
||||||
|
callbacks := struct {
|
||||||
|
fullNodeFilteredAPI
|
||||||
|
*WindowPoStScheduler
|
||||||
|
}{s.api, s}
|
||||||
|
|
||||||
|
s.ch = newChangeHandler(callbacks, s.actor)
|
||||||
defer s.ch.shutdown()
|
defer s.ch.shutdown()
|
||||||
s.ch.start()
|
s.ch.start()
|
||||||
|
|
||||||
var notifs <-chan []*api.HeadChange
|
var (
|
||||||
var err error
|
notifs <-chan []*api.HeadChange
|
||||||
var gotCur bool
|
err error
|
||||||
|
gotCur bool
|
||||||
|
)
|
||||||
|
|
||||||
// not fine to panic after this point
|
// not fine to panic after this point
|
||||||
for {
|
for {
|
||||||
|
Loading…
Reference in New Issue
Block a user