Zap onchain BTC address does not belong to lnd wallet to which I'm connected to
See original GitHub issueDescription
I’m using Zap with my own lnd node. I had a lnd node, closed all channels and emptied out the wallet. Formatted HD, created new lnd node, restored a different older wallet.
Connected Zap to it. At this point, I think the sync for lnd wasn’t finished. Then I was reckless, and sent a considerable sats amount in the address generated in Zap. The funds didn’t show up, I thought it was because the node didn’t sync yet. But, after syncing, funds not there yet.
Connecting to lnd, I seems that the address generated by Zap does not belong to my wallet. I tried running dropwtxmgr on my lnd wallet. This resulted in some older tx for this wallet (a few months old, since this was a restored, but empty wallet) showing up, but not the one that I just did.lncli newaddress generates different address than that found in Zap.
Confirmed with small amounts that new transactions to the address in Zap don’t show up, but the ones to the lncli newaddress do show up.
Edit: sorry for the description not being clear enough, see: https://github.com/LN-Zap/zap-desktop/issues/3478#issuecomment-619617989
Expected Behavior
Onchain address in Zap should be the same with the one in lncli neweaddress
Onchain address in Zap should belong to my lnd wallet
Actual Behavior
Different address
Address doesn’t belong to my wallet
Possible Fix
I hope there is one
Steps to Reproduce
I tried to reproduce it now on a Polar simnet network (just once tbh) using dev, but didn’t manage to. Still, my release Zap is in this inconsistent state.
Context
Your Environment
- Zap version: 0.6.2-beta
- Operating System and version: mac OS Catalina
- lnd: 0.9.2-beta
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (6 by maintainers)

Top Related StackOverflow Question
Yes, exactly, I think this is a serious bug if we confirm it and it’s better to get it fixed, that’s why I didn’t mess up too much with my node since this happened. Okay, I’ll take a look. I’m also on Slack if you prefer that.
This is definitely not a bug in Zap. Zap got the address by calling the node’s gRPC NextAddr while lnd was restoring from a backup. Looks like somehow that address returned by lnd was outside the default recovery window. Using a window larger than the default did the trick. Thank you @mrfelton for the support!