ledger: Close device in WalletNew

This commit is contained in:
Łukasz Magiera 2020-10-12 09:21:42 +02:00
parent 4ac2bee81c
commit 8b648cf77c

View File

@ -201,6 +201,7 @@ func (lw LedgerWallet) WalletNew(ctx context.Context, t types.KeyType) (address.
if err != nil { if err != nil {
return address.Undef, xerrors.Errorf("finding ledger: %w", err) return address.Undef, xerrors.Errorf("finding ledger: %w", err)
} }
defer fl.Close() // nolint:errcheck
path := append(append([]uint32(nil), filHDBasePath...), uint32(maxi+1)) path := append(append([]uint32(nil), filHDBasePath...), uint32(maxi+1))
_, _, addr, err := fl.GetAddressPubKeySECP256K1(path) _, _, addr, err := fl.GetAddressPubKeySECP256K1(path)