Closed feelancer21 closed 6 months ago
We don't rescan on import yet, so that's working as expected.
Yes, but I get a 0 for both accounts (default and the new one).
And I cannot sweep the utxos of the default account now
[lncli] rpc error: code = Unknown desc = insufficient input to create sweep tx: input_sum=0 BTC, output_sum=0.00000106 BTC
Edit: My bictoind backend is a pruned node.
I think you need to use the lncli walletbalance --acctoun=imported
flag. By default walletbalance
only shows the balance of the "default" account (which is the internal wallet).
I did a basic test(regtest):
2 nodes, importing the default p2tr xpub into the other node. Although the imported xpub had funds on it, they are not shown on the other node, even after a rescan. So there seems to be a problem recognizing these new addresses from the pubkey ? Will try to find the problem ...
When you say rescan, what type of rescan do you mean?
lnd --reset-wallet-transactions
lnd --reset-wallet-transactions
Hmm, okay. I would've expected that to pick up the imported accounts too. But who knows, maybe they are explicitly excluded for some reason (the wallet code needs a lot of work...).
I think you need to use the
lncli walletbalance --acctoun=imported
flag. By defaultwalletbalance
only shows the balance of the "default" account (which is the internal wallet).
The problem is, that also my default account has a balance of 0 since the import.
"total_balance": "0",
"confirmed_balance": "0",
"unconfirmed_balance": "0",
"locked_balance": "0",
"reserved_balance_anchor_chan": "100000",
Seems that the import of the external account has destroyed some information. Because it is not possible to send the existing utxos of the default account at the moment.
Maybe it is edge case, when the backend is a pruned bitcoind node.
I think I have to switch to a full node and start a rescan.
So tested with several scenarios, current master but even 16.04 works fine and shows the default wallet balance, although I have imported several xpubs. So could not reproduce the issue, especially you said that your lncli listunspent
cmd worked perfectly fine, but the lncli walletbalance
showed an amount of 0 (they use almost the same backend call). So not reproducible for now.
Let us know if this happens again after your rescan.
Closing in favor of https://github.com/lightningnetwork/lnd/issues/8593.
Your environment
lnd 0.16.4 bitcond 25.0 (pruned)
Steps to reproduce
I imported an external xpub with
lncli walletbalance
shows a balance of 0 for both accounts. Butlncli listunspent
is still listing the correct utxos