Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Failed recover on-chain testnet funds with neutrino #9055

Open
AleAndForCode opened this issue Sep 1, 2024 · 1 comment
Open

[bug]: Failed recover on-chain testnet funds with neutrino #9055

AleAndForCode opened this issue Sep 1, 2024 · 1 comment
Labels
bug Unintended code behaviour neutrino Lightweight neutrino backend-type

Comments

@AleAndForCode
Copy link

Background

I was testing lnd recovery by attempting to recover a recently created testnet wallet with a non-zero balance. I followed the on-chain recovery instructions. After executing the recovery process, the recovery status showed as complete:

lncli getrecoveryinfo
{
    "recovery_mode": true,
    "recovery_finished": true,
    "progress": 1
}

However, the recovered wallet balance was zero.

Additionally, when generating a new address with lncli newaddress p2wkh, it produced the same address as before the restore. In my case, the address tb1qaa898gjprr5uh002kyqtnmpj02ur4vvw4v3ujh still has a balance, as confirmed by the testnet explorer here.

I also tried rebooting lnd and unlocking with a doubled recovery window, as well as launching lnd with the --reset-wallet-transactions flag. None of these steps resolved the issue. Please see the provided logs and screenshots for more details.

Logs contain a lot of such error messages:

[ERR] LNWL: Unable to synchronize wallet to chain, trying again in 5s: unable to perform wallet recovery: failed to store sync information 00000000f2ba832b40294ba33f8f005221af639aa3458d3fbc1b8da0a6a58105: failed to fetch block hash for height 2902302: block not found

fail_to_recover
fail_to_recover_by_unlock
logs.zip

Environment

  • lnd version: v0.18.2-beta
  • Docker on Apple Silicon
  • Testnet with Neutrino backend
version: '3'

services:
    lnd:
      image: lightninglabs/lnd:v0.18.2-beta
      container_name: lnd-testnet
      environment:
        LNCLI_NETWORK: testnet
      volumes:
        - ./testnet-data:/root/.lnd
      command: >
        --bitcoin.active
        --bitcoin.testnet
        --bitcoin.node=neutrino
        --feeurl https://pastacity.nl/VjtaVK73NZwGBAisrA3iFg
        --debuglevel=debug

Steps to reproduce

Start the lnd service.
Follow the on-chain recovery instructions. Use lncli to create a seed and passphrase from an existing, recently created lnd wallet with a non-zero on-chain balance. Set the recovery window to the default value. Wait until lncli getrecoveryinfo shows recovery_finished = true.
Check the wallet balance with lncli walletbalance.

Expected behaviour

The wallet should show the restored on-chain balance after recovery.

Actual behaviour

The recovered wallet balance is zero:

{
    "total_balance":  "0",
    "confirmed_balance":  "0",
    "unconfirmed_balance":  "0",
    "locked_balance":  "0",
    "reserved_balance_anchor_chan":  "0",
    "account_balance":  {
        "default":  {
            "confirmed_balance":  "0",
            "unconfirmed_balance":  "0"
        }
    }
}
@AleAndForCode AleAndForCode added bug Unintended code behaviour needs triage labels Sep 1, 2024
@guggero
Copy link
Collaborator

guggero commented Sep 2, 2024

Did you abort the recovery process at some point (e.g. restart lnd) while it was still scanning the chain? That unfortunately will stop the recovery and then it won't continue on the next startup (it's a known issue, see #7111).

@saubyk saubyk added neutrino Lightweight neutrino backend-type and removed needs triage labels Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended code behaviour neutrino Lightweight neutrino backend-type
Projects
None yet
Development

No branches or pull requests

3 participants