{"action":"created","issue":{"url":"https://api.github.com/repos/LN-Zap/zap-desktop/issues/538","repository_url":"https://api.github.com/repos/LN-Zap/zap-desktop","labels_url":"https://api.github.com/repos/LN-Zap/zap-desktop/issues/538/labels{/name}","comments_url":"https://api.github.com/repos/LN-Zap/zap-desktop/issues/538/comments","events_url":"https://api.github.com/repos/LN-Zap/zap-desktop/issues/538/events","html_url":"https://github.com/LN-Zap/zap-desktop/pull/538","id":338966066,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NzY4MTc4","number":538,"title":"Handle case where BTCd node is not fully synced with the blockchain","user":{"login":"mrfelton","id":200251,"node_id":"MDQ6VXNlcjIwMDI1MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/200251?v=4","gravatar_id":"","url":"https://api.github.com/users/mrfelton","html_url":"https://github.com/mrfelton","followers_url":"https://api.github.com/users/mrfelton/followers","following_url":"https://api.github.com/users/mrfelton/following{/other_user}","gists_url":"https://api.github.com/users/mrfelton/gists{/gist_id}","starred_url":"https://api.github.com/users/mrfelton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrfelton/subscriptions","organizations_url":"https://api.github.com/users/mrfelton/orgs","repos_url":"https://api.github.com/users/mrfelton/repos","events_url":"https://api.github.com/users/mrfelton/events{/privacy}","received_events_url":"https://api.github.com/users/mrfelton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-07-06T14:44:48Z","updated_at":"2018-07-12T16:08:09Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls/538","html_url":"https://github.com/LN-Zap/zap-desktop/pull/538","diff_url":"https://github.com/LN-Zap/zap-desktop/pull/538.diff","patch_url":"https://github.com/LN-Zap/zap-desktop/pull/538.patch"},"body":"Handle the case were the Neutrino backend BTCd node is still synchronising the blockchain as LND is not able to start syncing until the BTCd node that it is connected to is fully synced.\r\n\r\nIn this case, we display a message to the user indicating that we are waiting for peers. If it takes more than 10 seconds that generally indicates that the btcd node is quite far behind (eg, it has been restarted and is doing a full/fresh sync) and so after 10 seconds of waiting we advise the user that it could take some time.\r\n\r\nThis PR corrects a bug from https://github.com/LN-Zap/zap-desktop/pull/529 where we calculate the current block height incorrectly. In that PR, we incorrectly assumed that the message `Syncing to block height X` from lnd would tell us the current block height however it actually only tells us the highest block that BTCd is aware of (ie, the highest block that it has already synced). To resolve that and ensure that we know the actual current block height, we fetch the block height from the block explorers and we now do this as early as possible from the main process rather than waiting for the react `Syncing` component to mount."},"comment":{"url":"https://api.github.com/repos/LN-Zap/zap-desktop/issues/comments/404565383","html_url":"https://github.com/LN-Zap/zap-desktop/pull/538#issuecomment-404565383","issue_url":"https://api.github.com/repos/LN-Zap/zap-desktop/issues/538","id":404565383,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDU2NTM4Mw==","user":{"login":"mrfelton","id":200251,"node_id":"MDQ6VXNlcjIwMDI1MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/200251?v=4","gravatar_id":"","url":"https://api.github.com/users/mrfelton","html_url":"https://github.com/mrfelton","followers_url":"https://api.github.com/users/mrfelton/followers","following_url":"https://api.github.com/users/mrfelton/following{/other_user}","gists_url":"https://api.github.com/users/mrfelton/gists{/gist_id}","starred_url":"https://api.github.com/users/mrfelton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrfelton/subscriptions","organizations_url":"https://api.github.com/users/mrfelton/orgs","repos_url":"https://api.github.com/users/mrfelton/repos","events_url":"https://api.github.com/users/mrfelton/events{/privacy}","received_events_url":"https://api.github.com/users/mrfelton/received_events","type":"User","site_admin":false},"created_at":"2018-07-12T16:08:09Z","updated_at":"2018-07-12T16:08:09Z","author_association":"COLLABORATOR","body":"The other issue is that in master, if you connect to a BTCd node that is mid-way through syncing, we calculate the current block height incorrectly as we assume that one of the numbers given to us in the lnd log output is the current block height, where as in actual fact it is only the current highest block that BTCd has actually synced."}}
{"actor":{"display_login":"mrfelton"}}