{"action":"created","issue":{"url":"https://api.github.com/repos/lightningnetwork/lnd/issues/3321","repository_url":"https://api.github.com/repos/lightningnetwork/lnd","labels_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/3321/labels{/name}","comments_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/3321/comments","events_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/3321/events","html_url":"https://github.com/lightningnetwork/lnd/issues/3321","id":469178468,"node_id":"MDU6SXNzdWU0NjkxNzg0Njg=","number":3321,"title":"Restoring channels hits multiple hickups","user":{"login":"stefanwouldgo","id":722576,"node_id":"MDQ6VXNlcjcyMjU3Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/722576?v=4","gravatar_id":"","url":"https://api.github.com/users/stefanwouldgo","html_url":"https://github.com/stefanwouldgo","followers_url":"https://api.github.com/users/stefanwouldgo/followers","following_url":"https://api.github.com/users/stefanwouldgo/following{/other_user}","gists_url":"https://api.github.com/users/stefanwouldgo/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanwouldgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanwouldgo/subscriptions","organizations_url":"https://api.github.com/users/stefanwouldgo/orgs","repos_url":"https://api.github.com/users/stefanwouldgo/repos","events_url":"https://api.github.com/users/stefanwouldgo/events{/privacy}","received_events_url":"https://api.github.com/users/stefanwouldgo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2019-07-17T12:58:40Z","updated_at":"2019-07-18T14:18:25Z","closed_at":null,"author_association":"NONE","body":"### Background\r\n\r\nI was running LND 0.6.1 on bitcoin 0.18.0 on my old phone (Termux). Copying channel updates by inotify. Then my micro sd containing .lnd died. \r\n\r\nAfter I received my new card, I tried restoring both offchain and onchain funds using \r\n`lncli create -multi_file=channels.backup` (on 0.6.1 again), but LND crashed. Sorry, I didn't get any logs.\r\n\r\nInstead, I tried the same on the just released 0.7.0. This time, it didn't crash, and the onchain balance got restored, but the channels didn't get closed. I used to have two channels open with funds on my side. One didn't show up at all, the other remained in waiting_close_channels. When I tried to force-close this one, LND crashed again, saying something along the lines of \"chain-link missing\".\r\n\r\nSo I tried it a third time, this time first doing just `lncli create` (with the seed), then later `lncli restorechanbackup`. This again restored the onchain funds. One channel is again in waiting_close_channels, and this time, the other channel is also here, but it's in pending_force_close_channels (and the commitment-tx has long been confirmed). \r\n\r\n\r\n### Your environment\r\n\r\n* version of `lnd` \r\n\r\n0.7.0 (from 0.6.1)\r\n\r\n* which operating system (`uname -a` on *Nix)\r\n\r\nLinux localhost 3.4.0-perf-gbccb33a #1 SMP PREEMPT Fri Jul 10 09:23:01 2015 armv7l Android\r\n\r\n* version of `btcd`, `bitcoind`, or other backend\r\n\r\nbitcoind 0.18.0\r\n\r\n* any other relevant environment details\r\n\r\n### Steps to reproduce\r\n\r\nprobably hard to reproduce. Kill your .lnd with open channels, then try to restore.\r\n\r\n### Expected behaviour\r\n\r\nAll open channels should be closed and the funds be returned to my wallet.\r\n\r\n### Actual behaviour\r\n\r\nOnchain funds got returned, but it appears that one force-closed channel isn't recognized as returned to us while another is kept open, and makes lnd crash on force-close.\r\n"},"comment":{"url":"https://api.github.com/repos/lightningnetwork/lnd/issues/comments/512835654","html_url":"https://github.com/lightningnetwork/lnd/issues/3321#issuecomment-512835654","issue_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/3321","id":512835654,"node_id":"MDEyOklzc3VlQ29tbWVudDUxMjgzNTY1NA==","user":{"login":"stefanwouldgo","id":722576,"node_id":"MDQ6VXNlcjcyMjU3Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/722576?v=4","gravatar_id":"","url":"https://api.github.com/users/stefanwouldgo","html_url":"https://github.com/stefanwouldgo","followers_url":"https://api.github.com/users/stefanwouldgo/followers","following_url":"https://api.github.com/users/stefanwouldgo/following{/other_user}","gists_url":"https://api.github.com/users/stefanwouldgo/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanwouldgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanwouldgo/subscriptions","organizations_url":"https://api.github.com/users/stefanwouldgo/orgs","repos_url":"https://api.github.com/users/stefanwouldgo/repos","events_url":"https://api.github.com/users/stefanwouldgo/events{/privacy}","received_events_url":"https://api.github.com/users/stefanwouldgo/received_events","type":"User","site_admin":false},"created_at":"2019-07-18T14:18:25Z","updated_at":"2019-07-18T14:18:25Z","author_association":"NONE","body":"I guess this portion of the logs is relevant, if privacy-killing: \r\n\r\n```\r\n2019-07-11 08:47:33.021 [INF] NTFN: Dispatching confirmed spend notification for outpoint=e8d2c8a62808377520c7926ece00c925f942cdff832bca5d6c6b08695bddc180:0 at height=584903 2019-07-11 08:47:33.125 [WRN] CNCT: Unprompted commitment broadcast for ChannelPoint(e8d2c8a62808377520c7926ece00c925f942cdff832bca5d6c6b08695bddc180:0)\r\n2019-07-11 08:47:33.125 [WRN] CNCT: Remote node broadcast state #18, which is more than 1 beyond best known state #0!!! Attempting recovery...\r\n2019-07-11 08:47:33.126 [INF] CNCT: Recovered commit point(023e2a39aba2501787242cef37e4e236672e12b5cdac5accbb01ba9bcd5ffc9175) for channel(e8d2c8a62808377520c7926ece00c925f942cdff832bca5d6c6b08695bddc180:0)! Now attempting to use it to sweep our funds...\r\n2019-07-11 08:47:33.127 [INF] CNCT: Unilateral close of ChannelPoint(e8d2c8a62808377520c7926ece00c925f942cdff832bca5d6c6b08695bddc180:0) detected\r\n2019-07-11 08:47:33.147 [INF] CNCT: ChannelArbitrator(e8d2c8a62808377520c7926ece00c925f942cdff832bca5d6c6b08695bddc180:0): remote party has closed channel out on-chain\r\n2019-07-11 08:47:33.306 [INF] CHBU: Updating on-disk multi SCB backup: num_old_chans=0, num_new_chans=0\r\n2019-07-11 08:47:33.332 [INF] NTFN: New confirmation subscription: txid=bef38f19cf9adf21f92da432cf477b060721caeb22e8d1bbdf9e1825e1780bdf, num_confs=1\r\n2019-07-11 08:47:33.333 [INF] NTFN: New confirmation subscription: conf_id=1, txid=bef38f19cf9adf21f92da432cf477b060721caeb22e8d1bbdf9e1825e1780bdf, height_hint=583962\r\n2019-07-11 08:47:33.359 [INF] CNCT: ChannelArbitrator(e8d2c8a62808377520c7926ece00c925f942cdff832bca5d6c6b08695bddc180:0): still awaiting contract resolution\r\n2019-07-11 08:47:33.440 [INF] CHBU: Updating backup file at /data/data/com.termux/files/home/.lnd/data/chain/bitcoin/mainnet/channel.backup\r\n2019-07-11 08:47:33.470 [INF] CHBU: Swapping old multi backup file from /data/data/com.termux/files/home/.lnd/data/chain/bitcoin/mainnet/temp-dont-use.backup to /data/data/com.termux/files/home/.lnd/data/chain/bitcoin/mainnet/channel.backup\r\n2019-07-11 08:47:37.004 [INF] NTFN: Dispatching confirmed spend notification for outpoint=b1e2a036daf3e559d8b0c6c8ec8e430778ca5d4d7f0602fb14ead947ef60fcba:0 at height=584903 2019-07-11 08:47:37.018 [WRN] CNCT: Unprompted commitment broadcast for ChannelPoint(b1e2a036daf3e559d8b0c6c8ec8e430778ca5d4d7f0602fb14ead947ef60fcba:0)\r\n2019-07-11 08:47:37.021 [WRN] CNCT: Remote node broadcast state #25, which is more than 1 beyond best known state #0!!! Attempting recovery...\r\n2019-07-11 08:47:37.023 [INF] CNCT: Recovered commit point(0271efe6a8518d4b4bf189e44a1eeddaea14d873140a60c613926430109c65fe8f) for channel(b1e2a036daf3e559d8b0c6c8ec8e430778ca5d4d7f0602fb14ead947ef60fcba:0)! Now attempting to use it to sweep our funds...\r\n2019-07-11 08:47:37.026 [INF] CNCT: Unilateral close of ChannelPoint(b1e2a036daf3e559d8b0c6c8ec8e430778ca5d4d7f0602fb14ead947ef60fcba:0) detected\r\n2019-07-11 08:47:37.038 [INF] CNCT: ChannelArbitrator(b1e2a036daf3e559d8b0c6c8ec8e430778ca5d4d7f0602fb14ead947ef60fcba:0): remote party has closed channel out on-chain\r\n2019-07-11 08:47:37.275 [INF] CHBU: Updating on-disk multi SCB backup: num_old_chans=0, num_new_chans=0\r\n2019-07-11 08:47:37.289 [INF] CNCT: ChannelArbitrator(b1e2a036daf3e559d8b0c6c8ec8e430778ca5d4d7f0602fb14ead947ef60fcba:0): contract resolutions empty, marking channel as fully resolved!\r\n```"}}
{"actor":{"display_login":"stefanwouldgo"}}