numassigner: Don't error on fresh non-genesis miners

This commit is contained in:
Łukasz Magiera 2022-08-22 17:49:58 -04:00
parent 64290b69c9
commit c18874c122

View File

@ -103,11 +103,13 @@ func (m *Sealing) numAssignerMetaLocked(ctx context.Context) (api.NumAssignerMet
var i uint64
{
curBytes, err := m.ds.Get(ctx, datastore.NewKey(StorageCounterDSPrefix))
if err != nil {
if err != nil && err != datastore.ErrNotFound {
return api.NumAssignerMeta{}, err
}
cur, _ := binary.Uvarint(curBytes)
i = cur + 1
if err == nil {
cur, _ := binary.Uvarint(curBytes)
i = cur + 1
}
}
rl := &rlepluslazy.RunSliceIterator{Runs: []rlepluslazy.Run{