lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.7k stars 2.09k forks source link

[BUG] Cannot restore on-chain balance #3352

Closed boodyvo closed 5 years ago

boodyvo commented 5 years ago

Background

I cannot recover my on-chain balance with seed words. I also tried to use dropwtxmgr that is mentioned in recovery.md but it provided same result. I have tried 3 times and never got on-chain balance > 0 after recovery.

Your environment

Steps to reproduce

  1. Run lnd to store data in folder named "qwe" ($ export USERNAME=qwe).
  2. Create wallet:
    
    $ lncli --rpcserver localhost:10009 --tlscertpath ./tls.cert --macaroonpath ./admin.macaroon create
    Input wallet password: 
    Confirm password:

Do you have an existing cipher seed mnemonic you want to use? (Enter y/n): y

Input your 24-word mnemonic separated by spaces: absorb drop dignity involve school uncle skirt total arch razor general liar nothing antenna muffin cabin best exact frame episode thumb pet bacon snap

Input your cipher seed passphrase (press enter if your seed doesn't have a passphrase): Input an optional address look-ahead used to scan for used keys (default 2500):

!!!YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!!!

---------------BEGIN LND CIPHER SEED---------------

  1. absorb 2. drop 3. dignity 4. involve
  2. school 6. uncle 7. skirt 8. total
  3. arch 10. razor 11. general 12. liar
    1. nothing 14. antenna 15. muffin 16. cabin
    2. best 18. exact 19. frame 20. episode
    3. thumb 22. pet 23. bacon 24. snap
      ---------------END LND CIPHER SEED-----------------

!!!YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!!!

lnd successfully initialized!


3. Check walletbalance:

$ lncli --rpcserver localhost:10009 --tlscertpath ./tls.cert --macaroonpath ./admin.macaroon walletbalance { "total_balance": "0", "confirmed_balance": "0", "unconfirmed_balance": "0" }


4. Generate p2wkh address and send money to it from btcd

$ lncli --rpcserver localhost:10009 --tlscertpath ./tls.cert --macaroonpath ./admin.macaroon newaddress p2wkh { "address": "bcrt1qfct2epn56d0ygjsjeqdqrpv8ljnm8x6zanus4s" }


5. Check balance

$ lncli --rpcserver localhost:10009 --tlscertpath ./tls.cert --macaroonpath ./admin.macaroon walletbalance { "total_balance": "200000000", "confirmed_balance": "0", "unconfirmed_balance": "200000000" }


6. Stop lnd and run new lnd to store data in folder named "asd" (`$ export USERNAME=asd`).

7. Create wallet with same seed mnemonic

$ lncli --rpcserver localhost:10009 --tlscertpath ./tls.cert --macaroonpath ./admin.macaroon create Input wallet password: Confirm password:

Do you have an existing cipher seed mnemonic you want to use? (Enter y/n): y

Input your 24-word mnemonic separated by spaces: absorb drop dignity involve school uncle skirt total arch razor general liar nothing antenna muffin cabin best exact frame episode thumb pet bacon snap

Input your cipher seed passphrase (press enter if your seed doesn't have a passphrase): Input an optional address look-ahead used to scan for used keys (default 2500):

!!!YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!!!

---------------BEGIN LND CIPHER SEED---------------

  1. absorb 2. drop 3. dignity 4. involve
  2. school 6. uncle 7. skirt 8. total
  3. arch 10. razor 11. general 12. liar
    1. nothing 14. antenna 15. muffin 16. cabin
    2. best 18. exact 19. frame 20. episode
    3. thumb 22. pet 23. bacon 24. snap
      ---------------END LND CIPHER SEED-----------------

!!!YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!!!

lnd successfully initialized!


8. Check lnd balance after it synced:

$ lncli --rpcserver localhost:10009 --tlscertpath ./tls.cert --macaroonpath ./admin.macaroon getinfo { "version": "0.7.1-beta commit=v0.7.1-beta-rc2", "identity_pubkey": "03e872130bd2f879e9f470c55770bf70b8830e6b2403d3e9a9b1f7513ae25803c8", "alias": "03e872130bd2f879e9f4", "color": "#3399ff", "num_pending_channels": 0, "num_active_channels": 0, "num_inactive_channels": 0, "num_peers": 0, "block_height": 449, "block_hash": "52c96c78af31d2775997fe2088a9860b9b15bb67a8cd9819dddc0638147dcfa1", "best_header_timestamp": 1564404598, "synced_to_chain": true, "testnet": false, "chains": [ { "chain": "bitcoin", "network": "regtest" } ], "uris": null } $ lncli --rpcserver localhost:10009 --tlscertpath ./tls.cert --macaroonpath ./admin.macaroon walletbalance { "total_balance": "0", "confirmed_balance": "0", "unconfirmed_balance": "0" }


### Expected behaviour

Got my on chain balance after recovery:

$ lncli --rpcserver localhost:10009 --tlscertpath ./tls.cert --macaroonpath ./admin.macaroon walletbalance { "total_balance": "200000000", "confirmed_balance": "0", "unconfirmed_balance": "200000000" }


### Actual behaviour

Got 0 balance:

$ lncli --rpcserver localhost:10009 --tlscertpath ./tls.cert --macaroonpath ./admin.macaroon walletbalance { "total_balance": "0", "confirmed_balance": "0", "unconfirmed_balance": "0" }

wpaulino commented 5 years ago

Unable to reproduce. I assume you're maintaining the same chain before and after the recovery?

boodyvo commented 5 years ago

Yes. I had the same blockchain. After recover lnd has correct height (same as before), but doesn't have appropriate balance.

Roasbeef commented 5 years ago

What period of time passes between the recovery and the start? Also unless you provide logs or other information, we don't have much to go off of here, since we're unable to reproduce (and also have various integration tests for this scenario).

boodyvo commented 5 years ago

As I noticed itest is for simnet. And I tried on regtest. Could it be the reason? Firtly, I faced this problem on testnet I tried one more time from the very beginning and got such logs (with same result):

ITs-MacBook-Pro:peach-wallet-desktop vladyslavbudichenko$ ./runlnd.sh 
2019-07-30 12:14:32.850 [WRN] LTND: open /Users/vladyslavbudichenko/Library/Application Support/lightning-peach-wallet/.lnd/test1/lnd.conf: no such file or directory
2019-07-30 12:14:32.851 [INF] LTND: Version: 0.7.1-beta commit=v0.7.1-beta-rc2, build=production, logging=default
2019-07-30 12:14:32.851 [INF] LTND: Active chain: Bitcoin (network=regtest)
2019-07-30 12:14:32.893 [INF] CHDB: Checking for schema update: latest_version=9, db_version=9
2019-07-30 12:14:32.894 [INF] RPCS: Generating TLS certificates...
2019-07-30 12:14:32.917 [INF] RPCS: Done generating TLS certificates
2019-07-30 12:14:32.934 [INF] RPCS: password gRPC proxy started at 0.0.0.0:10014
2019-07-30 12:14:32.931 [INF] RPCS: password RPC server listening on 0.0.0.0:10009
2019-07-30 12:14:32.964 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create a wallet, `lncli unlock` to unlock an existing wallet, or `lncli changepassword` to change the password of an existing wallet and unlock it.
2019-07-30 12:18:58.572 [INF] LNWL: Opened wallet
2019-07-30 12:18:58.708 [INF] LTND: Primary chain is set to: bitcoin
2019-07-30 12:18:59.453 [INF] LNWL: The wallet has been unlocked without a time limit
2019-07-30 12:18:59.567 [INF] LTND: LightningWallet opened
2019-07-30 12:18:59.634 [INF] LNWL: Started rescan from block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206 (height 0) for 0 addresses
2019-07-30 12:18:59.663 [INF] HSWC: Restoring in-memory circuit state from disk
2019-07-30 12:18:59.670 [INF] HSWC: Payment circuits loaded: num_pending=0, num_open=0
2019-07-30 12:18:59.706 [INF] SWPR: Migrating UTXO nursery finalized TXIDs
2019-07-30 12:18:59.718 [INF] LTND: Channel backup proxy channel notifier starting
2019-07-30 12:18:59.720 [INF] ATPL: Instantiating autopilot with cfg: (*lnd.autoPilotConfig)(0xc000212900)({
 Active: (bool) true,
 Heuristic: (map[string]float64) (len=1) {
  (string) (len=12) "preferential": (float64) 1
 },
 MaxChannels: (int) 5,
 Allocation: (float64) 0.6,
 MinChannelSize: (int64) 20000,
 MaxChannelSize: (int64) 16777215,
 Private: (bool) false,
 MinConfs: (int32) 1,
 ConfTarget: (uint32) 3
})

2019-07-30 12:18:59.722 [INF] RPCS: RPC server listening on 0.0.0.0:10009
2019-07-30 12:18:59.753 [INF] LNWL: Catching up block hashes to height 449, this might take a while
2019-07-30 12:18:59.762 [INF] RPCS: gRPC proxy started at 0.0.0.0:10014
2019-07-30 12:18:59.858 [INF] NTFN: New block epoch subscription
2019-07-30 12:18:59.858 [INF] HSWC: Starting HTLC Switch
2019-07-30 12:18:59.858 [INF] NTFN: New block epoch subscription
2019-07-30 12:18:59.867 [INF] NTFN: New block epoch subscription
2019-07-30 12:18:59.875 [INF] NTFN: New block epoch subscription
2019-07-30 12:18:59.881 [INF] DISC: Authenticated Gossiper is starting
2019-07-30 12:18:59.881 [INF] BRAR: Starting contract observer, watching for breaches.
2019-07-30 12:18:59.881 [INF] NTFN: New block epoch subscription
2019-07-30 12:18:59.893 [INF] CRTR: FilteredChainView starting
2019-07-30 12:18:59.950 [INF] CRTR: Filtering chain using 0 channels active
2019-07-30 12:18:59.952 [INF] CRTR: Prune tip for Channel Graph: height=449, hash=52c96c78af31d2775997fe2088a9860b9b15bb67a8cd9819dddc0638147dcfa1
2019-07-30 12:18:59.963 [INF] CHBU: Starting chanbackup.SubSwapper
2019-07-30 12:18:59.964 [INF] CMGR: Server listening on [::]:9739
2019-07-30 12:18:59.972 [INF] SRVR: Auto peer bootstrapping is disabled
2019-07-30 12:18:59.972 [INF] ATPL: Autopilot Agent starting
2019-07-30 12:18:59.973 [INF] WTWR: Starting watchtower
2019-07-30 12:18:59.973 [INF] WTWR: Starting lookout
2019-07-30 12:18:59.973 [INF] WTWR: Starting lookout from chain tip
2019-07-30 12:18:59.974 [INF] NTFN: New block epoch subscription
2019-07-30 12:18:59.974 [INF] WTWR: Lookout started successfully
2019-07-30 12:18:59.974 [INF] WTWR: Starting watchtower server
2019-07-30 12:18:59.974 [INF] WTWR: Watchtower server started successfully
2019-07-30 12:18:59.974 [INF] WTWR: Watchtower started successfully
2019-07-30 12:18:59.974 [INF] CMGR: Server listening on [::]:9911
2019-07-30 12:19:00.566 [INF] LNWL: Done catching up block hashes
2019-07-30 12:19:00.567 [INF] LNWL: Finished rescan for 0 addresses (synced to block 52c96c78af31d2775997fe2088a9860b9b15bb67a8cd9819dddc0638147dcfa1, height 449)
2019-07-30 12:19:00.576 [INF] CHBU: Updating backup file at /Users/vladyslavbudichenko/Library/Application Support/lightning-peach-wallet/.lnd/test1/data/chain/bitcoin/regtest/channel.backup
2019-07-30 12:19:00.580 [INF] CHBU: Swapping old multi backup file from /Users/vladyslavbudichenko/Library/Application Support/lightning-peach-wallet/.lnd/test1/data/chain/bitcoin/regtest/temp-dont-use.backup to /Users/vladyslavbudichenko/Library/Application Support/lightning-peach-wallet/.lnd/test1/data/chain/bitcoin/regtest/channel.backup
2019-07-30 12:20:04.373 [INF] LNWL: Inserting unconfirmed transaction 68d530ad1491be4df145cd873e68560fc31cead704b4f2e3bb7e99fdc42e4d9c
2019-07-30 12:20:15.036 [INF] LNWL: Marking unconfirmed transaction 68d530ad1491be4df145cd873e68560fc31cead704b4f2e3bb7e99fdc42e4d9c mined in block 450
2019-07-30 12:20:15.039 [INF] CRTR: Pruning channel graph using block 37e2685c079ad7fcf434095fd6c3113010a8c263cd0a4aad184f29dcf7cf3b16 (height=450)
2019-07-30 12:20:15.061 [INF] NTFN: New block: height=450, sha=37e2685c079ad7fcf434095fd6c3113010a8c263cd0a4aad184f29dcf7cf3b16
2019-07-30 12:20:15.065 [INF] NTFN: New block: height=451, sha=3e460958f13d8aff069baab27f60a694c5d0d0e59ab5ef0e4b33f2016e56149a
2019-07-30 12:20:15.066 [INF] UTXN: Attempting to graduate height=450: num_kids=0, num_babies=0
2019-07-30 12:20:15.068 [INF] UTXN: Attempting to graduate height=451: num_kids=0, num_babies=0
2019-07-30 12:20:15.068 [INF] CRTR: Block 37e2685c079ad7fcf434095fd6c3113010a8c263cd0a4aad184f29dcf7cf3b16 (height=450) closed 0 channels
2019-07-30 12:20:15.068 [INF] CRTR: Pruning channel graph using block 3e460958f13d8aff069baab27f60a694c5d0d0e59ab5ef0e4b33f2016e56149a (height=451)
2019-07-30 12:20:15.073 [INF] ATPL: Triggering attachment directive dispatch, total_funds=2 BTC
2019-07-30 12:20:15.076 [INF] ATPL: No eligible candidates to connect to
2019-07-30 12:20:15.084 [INF] CRTR: Block 3e460958f13d8aff069baab27f60a694c5d0d0e59ab5ef0e4b33f2016e56149a (height=451) closed 0 channels
^C2019-07-30 12:20:25.488 [INF] LTND: Received interrupt
2019-07-30 12:20:25.488 [INF] LTND: Shutting down...
2019-07-30 12:20:25.490 [INF] LTND: Gracefully shutting down.
2019-07-30 12:20:25.490 [INF] WTWR: Stopping watchtower
2019-07-30 12:20:25.490 [INF] WTWR: Stopping watchtower server
2019-07-30 12:20:25.490 [INF] WTWR: Watchtower server stopped successfully
2019-07-30 12:20:25.491 [INF] WTWR: Stopping lookout
2019-07-30 12:20:25.491 [INF] NTFN: Cancelling epoch notification, epoch_id=6
2019-07-30 12:20:25.491 [INF] WTWR: Lookout stopped successfully
2019-07-30 12:20:25.491 [INF] WTWR: Watchtower stopped successfully
2019-07-30 12:20:25.491 [INF] HSWC: Block epoch canceled, decaying hash log shutting down
2019-07-30 12:20:25.491 [INF] CRTR: FilteredChainView stopping
2019-07-30 12:20:25.491 [INF] HSWC: HTLC Switch shutting down
2019-07-30 12:20:25.492 [INF] UTXN: UTXO nursery shutting down
2019-07-30 12:20:25.492 [INF] BRAR: Breach arbiter shutting down
2019-07-30 12:20:25.492 [INF] DISC: Authenticated Gossiper is stopping
2019-07-30 12:20:25.492 [INF] CNCT: Stopping ChainArbitrator
2019-07-30 12:20:25.493 [INF] FNDG: Funding manager shutting down
2019-07-30 12:20:25.493 [INF] CHBU: Stopping chanbackup.SubSwapper
2019-07-30 12:20:25.493 [INF] RPCS: Stopping RPC Server
2019-07-30 12:20:25.496 [INF] ATPL: Autopilot Agent stopping
2019-07-30 12:20:25.497 [INF] LTND: Shutdown complete
ITs-MacBook-Pro:peach-wallet-desktop vladyslavbudichenko$ export USERNAME=test2
ITs-MacBook-Pro:peach-wallet-desktop vladyslavbudichenko$ ./runlnd.sh 
2019-07-30 12:20:39.580 [WRN] LTND: open /Users/vladyslavbudichenko/Library/Application Support/lightning-peach-wallet/.lnd/test2/lnd.conf: no such file or directory
2019-07-30 12:20:39.580 [INF] LTND: Version: 0.7.1-beta commit=v0.7.1-beta-rc2, build=production, logging=default
2019-07-30 12:20:39.580 [INF] LTND: Active chain: Bitcoin (network=regtest)
2019-07-30 12:20:39.603 [INF] CHDB: Checking for schema update: latest_version=9, db_version=9
2019-07-30 12:20:39.604 [INF] RPCS: Generating TLS certificates...
2019-07-30 12:20:39.615 [INF] RPCS: Done generating TLS certificates
2019-07-30 12:20:39.616 [INF] RPCS: password RPC server listening on 0.0.0.0:10009
2019-07-30 12:20:39.616 [INF] RPCS: password gRPC proxy started at 0.0.0.0:10014
2019-07-30 12:20:39.616 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create a wallet, `lncli unlock` to unlock an existing wallet, or `lncli changepassword` to change the password of an existing wallet and unlock it.
2019-07-30 12:22:13.132 [INF] LNWL: Opened wallet
2019-07-30 12:22:13.133 [INF] LTND: Wallet recovery mode enabled with address lookahead of 2500 addresses
2019-07-30 12:22:13.252 [INF] LTND: Primary chain is set to: bitcoin
2019-07-30 12:22:13.975 [INF] LNWL: The wallet has been unlocked without a time limit
2019-07-30 12:22:14.047 [INF] LTND: LightningWallet opened
2019-07-30 12:22:14.090 [INF] LNWL: RECOVERY MODE ENABLED -- rescanning for used addresses with recovery_window=2500
2019-07-30 12:22:14.095 [INF] LNWL: Seed birthday surpassed, starting recovery of wallet from height=1 hash=7c0c09a15f4cdb1cf5db70cd058ff38fa2ed8571b511ea6f94fcbd92f11b1002 with recovery-window=2500
2019-07-30 12:22:14.110 [INF] HSWC: Restoring in-memory circuit state from disk
2019-07-30 12:22:14.116 [INF] HSWC: Payment circuits loaded: num_pending=0, num_open=0
2019-07-30 12:22:14.149 [INF] SWPR: Migrating UTXO nursery finalized TXIDs
2019-07-30 12:22:14.157 [INF] LTND: Channel backup proxy channel notifier starting
2019-07-30 12:22:14.157 [INF] ATPL: Instantiating autopilot with cfg: (*lnd.autoPilotConfig)(0xc0000c4a80)({
 Active: (bool) true,
 Heuristic: (map[string]float64) (len=1) {
  (string) (len=12) "preferential": (float64) 1
 },
 MaxChannels: (int) 5,
 Allocation: (float64) 0.6,
 MinChannelSize: (int64) 20000,
 MaxChannelSize: (int64) 16777215,
 Private: (bool) false,
 MinConfs: (int32) 1,
 ConfTarget: (uint32) 3
})

2019-07-30 12:22:14.158 [INF] RPCS: RPC server listening on 0.0.0.0:10009
2019-07-30 12:22:14.158 [INF] RPCS: gRPC proxy started at 0.0.0.0:10014
2019-07-30 12:22:14.265 [INF] NTFN: New block epoch subscription
2019-07-30 12:22:14.265 [INF] HSWC: Starting HTLC Switch
2019-07-30 12:22:14.265 [INF] NTFN: New block epoch subscription
2019-07-30 12:22:14.267 [INF] NTFN: New block epoch subscription
2019-07-30 12:22:14.270 [INF] NTFN: New block epoch subscription
2019-07-30 12:22:14.270 [INF] DISC: Authenticated Gossiper is starting
2019-07-30 12:22:14.270 [INF] BRAR: Starting contract observer, watching for breaches.
2019-07-30 12:22:14.273 [INF] NTFN: New block epoch subscription
2019-07-30 12:22:14.287 [INF] CRTR: FilteredChainView starting
2019-07-30 12:22:14.342 [INF] CRTR: Filtering chain using 0 channels active
2019-07-30 12:22:14.343 [INF] CRTR: Prune tip for Channel Graph: height=451, hash=3e460958f13d8aff069baab27f60a694c5d0d0e59ab5ef0e4b33f2016e56149a
2019-07-30 12:22:14.350 [INF] CHBU: Starting chanbackup.SubSwapper
2019-07-30 12:22:14.350 [INF] CMGR: Server listening on [::]:9739
2019-07-30 12:22:14.360 [INF] CHBU: Updating backup file at /Users/vladyslavbudichenko/Library/Application Support/lightning-peach-wallet/.lnd/test2/data/chain/bitcoin/regtest/channel.backup
2019-07-30 12:22:14.360 [INF] SRVR: Auto peer bootstrapping is disabled
2019-07-30 12:22:14.360 [INF] ATPL: Autopilot Agent starting
2019-07-30 12:22:14.360 [INF] WTWR: Starting watchtower
2019-07-30 12:22:14.360 [INF] WTWR: Starting lookout
2019-07-30 12:22:14.364 [INF] WTWR: Starting lookout from chain tip
2019-07-30 12:22:14.364 [INF] WTWR: Lookout started successfully
2019-07-30 12:22:14.364 [INF] NTFN: New block epoch subscription
2019-07-30 12:22:14.364 [INF] CHBU: Swapping old multi backup file from /Users/vladyslavbudichenko/Library/Application Support/lightning-peach-wallet/.lnd/test2/data/chain/bitcoin/regtest/temp-dont-use.backup to /Users/vladyslavbudichenko/Library/Application Support/lightning-peach-wallet/.lnd/test2/data/chain/bitcoin/regtest/channel.backup
2019-07-30 12:22:14.364 [INF] WTWR: Starting watchtower server
2019-07-30 12:22:14.364 [INF] WTWR: Watchtower server started successfully
2019-07-30 12:22:14.364 [INF] WTWR: Watchtower started successfully
2019-07-30 12:22:14.364 [INF] CMGR: Server listening on [::]:9911
2019-07-30 12:22:15.115 [INF] LNWL: Scanning 451 blocks for recoverable addresses
2019-07-30 12:22:17.237 [INF] LNWL: Fetching block height=160 hash=5b20aa20000ed3ce97d47a89f4d7a965feed5cca8dcf17ad064b9d115664a17d
2019-07-30 12:22:17.456 [INF] LNWL: Fetching block height=248 hash=11cfacd4f9cc6dad2db8abe4468904925378c73ea14b4b7796d875c92ac9f860
2019-07-30 12:22:17.812 [INF] LNWL: Fetching block height=403 hash=6a82abcd4a0f6b47031355e0b30b4a3be94a71505153f601d408b3aae77321ef
2019-07-30 12:22:17.818 [INF] LNWL: Fetching block height=406 hash=01735874441c5a97c0c0910895fc9bec887bbf71e20a90d7508b5cc724ca1134
2019-07-30 12:22:17.894 [INF] LNWL: Fetching block height=440 hash=33e1ea5b1f637f92d9afea9640c8cc02d00154730db6a061f32b656945e481bf
2019-07-30 12:22:17.929 [INF] LNWL: Recovered addresses from blocks 1-451
2019-07-30 12:22:17.942 [INF] LNWL: Started rescan from block 3e460958f13d8aff069baab27f60a694c5d0d0e59ab5ef0e4b33f2016e56149a (height 451) for 0 addresses
2019-07-30 12:22:17.953 [INF] LNWL: Catching up block hashes to height 451, this might take a while
2019-07-30 12:22:17.961 [INF] LNWL: Done catching up block hashes
2019-07-30 12:22:17.961 [INF] LNWL: Finished rescan for 0 addresses (synced to block 3e460958f13d8aff069baab27f60a694c5d0d0e59ab5ef0e4b33f2016e56149a, height 451)
boodyvo commented 5 years ago

I tried on testnet and had same experience. lnd address (p2wkh): tb1qp0durgmucp9k40l8d79setm5delj5aq749wu44 tx_hash: f9e16ce0e79c11857fdda72605a1aa3b6dce463db17fd6eb6c88453801242f5a

ITs-MacBook-Pro:test5 vladyslavbudichenko$ lncli --tlscertpath ./tls.cert --rpcserver 0.0.0.0:10009 --macaroonpath ./admin.macaroon create
Input wallet password: 
Confirm password:

Do you have an existing cipher seed mnemonic you want to use? (Enter y/n): n

Your cipher seed can optionally be encrypted.
Input your passphrase if you wish to encrypt it (or press enter to proceed without a cipher seed passphrase): 

Generating fresh cipher seed...

!!!YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!!!

---------------BEGIN LND CIPHER SEED---------------
 1. abstract   2. era        3. soft      4. what  
 5. height     6. negative   7. seven     8. hole  
 9. juice     10. forget    11. kiwi     12. fabric
13. exclude   14. umbrella  15. kick     16. boss  
17. material  18. fade      19. trigger  20. train 
21. unaware   22. cargo     23. hundred  24. guard 
---------------END LND CIPHER SEED-----------------

!!!YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!!!

lnd successfully initialized!
ITs-MacBook-Pro:test5 vladyslavbudichenko$ lncli --tlscertpath ./tls.cert --rpcserver 0.0.0.0:10009 --macaroonpath ./admin.macaroon newaddress p2wkh
{
    "address": "tb1qp0durgmucp9k40l8d79setm5delj5aq749wu44"
}
ITs-MacBook-Pro:test5 vladyslavbudichenko$ lncli --tlscertpath ./tls.cert --rpcserver 0.0.0.0:10009 --macaroonpath ./admin.macaroon newaddress np2wkh
{
    "address": "2N86QVdb7YGBeEPmeakxjjcodwXC4egE8aU"
}
ITs-MacBook-Pro:test5 vladyslavbudichenko$ lncli --tlscertpath ./tls.cert --rpcserver 0.0.0.0:10009 --macaroonpath ./admin.macaroon walletbalance
{
    "total_balance": "3688062",
    "confirmed_balance": "3688062",
    "unconfirmed_balance": "0"
}
ITs-MacBook-Pro:test5 vladyslavbudichenko$ cd ../test6
ITs-MacBook-Pro:test6 vladyslavbudichenko$ lncli --tlscertpath ./tls.cert --rpcserver 0.0.0.0:10009 --macaroonpath ./admin.macaroon create
Input wallet password: 
Confirm password:

Do you have an existing cipher seed mnemonic you want to use? (Enter y/n): y

Input your 24-word mnemonic separated by spaces: abandon melt suspect state attitude flee purchase sing physical people divide taste flee punch protect stereo stay venture country subject purchase drink flame advance

Input your cipher seed passphrase (press enter if your seed doesn't have a passphrase): 
Input an optional address look-ahead used to scan for used keys (default 2500): 

!!!YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!!!

---------------BEGIN LND CIPHER SEED---------------
 1. abandon    2. melt      3. suspect    4. state  
 5. attitude   6. flee      7. purchase   8. sing   
 9. physical  10. people   11. divide    12. taste  
13. flee      14. punch    15. protect   16. stereo 
17. stay      18. venture  19. country   20. subject
21. purchase  22. drink    23. flame     24. advance
---------------END LND CIPHER SEED-----------------

!!!YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!!!

lnd successfully initialized!
ITs-MacBook-Pro:test6 vladyslavbudichenko$ lncli --tlscertpath ./tls.cert --rpcserver 0.0.0.0:10009 --macaroonpath ./admin.macaroon walletbalance
{
    "total_balance": "0",
    "confirmed_balance": "0",
    "unconfirmed_balance": "0"
}
ITs-MacBook-Pro:test6 vladyslavbudichenko$ lncli --tlscertpath ./tls.cert --rpcserver 0.0.0.0:10009 --macaroonpath ./admin.macaroon walletbalance
{
    "total_balance": "0",
    "confirmed_balance": "0",
    "unconfirmed_balance": "0"
}
wpaulino commented 5 years ago

Not sure if it was just a typo, but a different seed is being used to restore in the testnet snippet.

molxyz commented 5 years ago

@boodyvo I've just tested your seed words and it works, I've got your balance. These seed words:

abstract era soft what height negative seven hole juice forget kiwi fabric exclude umbrella kick boss material fade trigger train unaware cargo hundred guard

It shows the exact balance:

>tlncli walletbalance

{
    "total_balance": "3688062",
    "confirmed_balance": "3688062",
    "unconfirmed_balance": "0"
}

It also shows your deposit tx:

>tlncli listchaintxns

{
    "transactions": [
        {
            "tx_hash": "f9e16ce0e79c11857fdda72605a1aa3b6dce463db17fd6eb6c88453801242f5a",
            "amount": "3688062",
            "num_confirmations": 181,
            "block_hash": "00000000000002ccf05314c8d095fa6325b176851ca0aa73643b349bcc3d5f9d",
            "block_height": 1571635,
            "time_stamp": "1564496079",
            "total_fees": "0",
            "dest_addresses": [
                "tb1qp0durgmucp9k40l8d79setm5delj5aq749wu44",
                "tb1ql256aztfcuk897uhxlt02uuknn3uhq8288e26t"
            ],
            "raw_tx_hex": "0200000001f094f5f510dedd4abe9779791bbd5d165c5a6ac17825e0397fcc04279d8053f1000000006a473044022066651e89ebd8e0588af049aab909cf650b0dbd07df945d06684d063416009ebe022021e9fe1a553bb473420fd0e215c0edbfb1bda2b848ef1f0095203b25d8d8c9ba012103842711dd54b0e087bc458952e482ef9b7605a74e02267d8e613e90c900b46b2ffeffffff027e463800000000001600140bdbc1a37cc04b6abfe76f8b0caf746e7f2a741e02fe450000000000160014faa9ae8969c72c72fb9737d6f573969ce3cb80ea32fb1700"
        }
    ]
}

So the onchain recovery works.

Roasbeef commented 5 years ago

Thanks for confirming @molxyz! Closing now as it seems to be an issue with your set up (or recovery process) rather than something being up with lnd. I'd recommend reviewing our recovery docs.