plumb through new sync status logic

This commit is contained in:
whyrusleeping
2019-11-15 17:05:16 -08:00
parent 7aa76d21d1
commit 251ff41134
5 changed files with 78 additions and 38 deletions
+13 -7
View File
@@ -20,13 +20,19 @@ type SyncAPI struct {
}
func (a *SyncAPI) SyncState(ctx context.Context) (*api.SyncState, error) {
ss := a.Syncer.State()
return &api.SyncState{
Base: ss.Base,
Target: ss.Target,
Stage: ss.Stage,
Height: ss.Height,
}, nil
states := a.Syncer.State()
out := &api.SyncState{}
for _, ss := range states {
out.ActiveSyncs = append(out.ActiveSyncs, api.ActiveSync{
Base: ss.Base,
Target: ss.Target,
Stage: ss.Stage,
Height: ss.Height,
})
}
return out, nil
}
func (a *SyncAPI) SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error {