multi: forward address and import calls over RPC

In order to support the full range of on-chain functionality, including
importing watch-only accounts in the watch-only instance, we need to
forward some calls like creating new addresses or importing accounts to
the remote signing instance.
This commit is contained in:
Oliver Gugger committed 2021-10-14 15:42:51 +02:00
1 parent 9cae7ad3c2
commit 19db382e24
6 files changed
+703 -441

No files matched your search

+11 -3
View File
@@ -507,9 +507,17 @@ func (w *WalletKit) NextAddr(ctx context.Context,
account = req.Account
}
addr, err := w.cfg.Wallet.NewAddress(
lnwallet.WitnessPubKey, false, account,
)
addrType := lnwallet.WitnessPubKey
switch req.Type {
case AddressType_NESTED_WITNESS_PUBKEY_HASH:
addrType = lnwallet.NestedWitnessPubKey
case AddressType_HYBRID_NESTED_WITNESS_PUBKEY_HASH:
return nil, fmt.Errorf("invalid address type for next "+
"address: %v", req.Type)
}
addr, err := w.cfg.Wallet.NewAddress(addrType, req.Change, account)
if err != nil {
return nil, err
}