Skip to content

Commit 71a5daf

Browse files
wallet: fix linting issues proposed by linter
1 parent 023bfd4 commit 71a5daf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

wallet/wallet.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4091,7 +4091,15 @@ func (w *Wallet) DeriveFromKeyPath(scope waddrmgr.KeyScope,
40914091
return fmt.Errorf("error deriving private key: %w", err)
40924092
}
40934093

4094-
privKey, err = addr.(waddrmgr.ManagedPubKeyAddress).PrivKey()
4094+
mpka, ok := addr.(waddrmgr.ManagedPubKeyAddress)
4095+
if !ok {
4096+
err := fmt.Errorf("managed address type for %v is "+
4097+
"`%T` but want waddrmgr.ManagedPubKeyAddress",
4098+
addr, addr)
4099+
4100+
return err
4101+
}
4102+
privKey, err = mpka.PrivKey()
40954103

40964104
return err
40974105
})

0 commit comments

Comments
 (0)