mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-17 12:21:41 +02:00
lnwallet: fix InternalKeyForAddr for imported addr
An address imported using ImportTapscript doesn't provide a private key so it can't satisfy waddrmgr.ManagedPubKeyAddress interface. So we don't return an error for imported addresses. Fix https://github.com/lightninglabs/loop/issues/923
This commit is contained in:
parent
b5c9df81f0
commit
429000e360
@ -660,6 +660,12 @@ func InternalKeyForAddr(wallet WalletController, netParams *chaincfg.Params,
|
|||||||
return none, nil
|
return none, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Imported addresses do not provide private keys, so they do not
|
||||||
|
// implement waddrmgr.ManagedPubKeyAddress. See RPC ImportTapscript.
|
||||||
|
if walletAddr.Imported() {
|
||||||
|
return none, nil
|
||||||
|
}
|
||||||
|
|
||||||
pubKeyAddr, ok := walletAddr.(waddrmgr.ManagedPubKeyAddress)
|
pubKeyAddr, ok := walletAddr.(waddrmgr.ManagedPubKeyAddress)
|
||||||
if !ok {
|
if !ok {
|
||||||
return none, fmt.Errorf("expected pubkey addr, got %T",
|
return none, fmt.Errorf("expected pubkey addr, got %T",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user