wallet: filter repo.ErrKeyNotFound
This commit is contained in:
parent
d8bd222cb1
commit
a968eef322
@ -5,6 +5,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-bls-sigs"
|
"github.com/filecoin-project/go-bls-sigs"
|
||||||
|
"github.com/filecoin-project/go-lotus/node/repo"
|
||||||
|
|
||||||
"github.com/minio/blake2b-simd"
|
"github.com/minio/blake2b-simd"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
@ -71,6 +73,9 @@ func (w *Wallet) findKey(addr address.Address) (*Key, error) {
|
|||||||
}
|
}
|
||||||
ki, err := w.keystore.Get(KNamePrefix + addr.String())
|
ki, err := w.keystore.Get(KNamePrefix + addr.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if xerrors.Is(err, repo.ErrKeyNotFound) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
return nil, xerrors.Errorf("getting from keystore: %w", err)
|
return nil, xerrors.Errorf("getting from keystore: %w", err)
|
||||||
}
|
}
|
||||||
k, err = NewKey(ki)
|
k, err = NewKey(ki)
|
||||||
|
Loading…
Reference in New Issue
Block a user