Skip to content

Commit 429000e

Browse files
committed
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 lightninglabs/loop#923
1 parent b5c9df8 commit 429000e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lnwallet/interface.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,12 @@ func InternalKeyForAddr(wallet WalletController, netParams *chaincfg.Params,
660660
return none, nil
661661
}
662662

663+
// Imported addresses do not provide private keys, so they do not
664+
// implement waddrmgr.ManagedPubKeyAddress. See RPC ImportTapscript.
665+
if walletAddr.Imported() {
666+
return none, nil
667+
}
668+
663669
pubKeyAddr, ok := walletAddr.(waddrmgr.ManagedPubKeyAddress)
664670
if !ok {
665671
return none, fmt.Errorf("expected pubkey addr, got %T",

0 commit comments

Comments
 (0)