From c18874c122da652af9802b048e66c93757518f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 22 Aug 2022 17:49:58 -0400 Subject: [PATCH] numassigner: Don't error on fresh non-genesis miners --- storage/pipeline/numassign.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/storage/pipeline/numassign.go b/storage/pipeline/numassign.go index 3b017213c..551d7a85e 100644 --- a/storage/pipeline/numassign.go +++ b/storage/pipeline/numassign.go @@ -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{