{"action":"created","comment":{"url":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls/comments/202199867","pull_request_review_id":136854405,"id":202199867,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjE5OTg2Nw==","diff_hunk":"@@ -5,20 +5,37 @@ import config from '../config'\n import { mainLog, lndLog, lndLogGetLevel } from '../../utils/log'\n import { fetchBlockHeight } from './util'\n \n+// Sync status is currenty pending.\n+const NEUTRINO_SYNC_STATUS_PENDING = 'chain-sync-pending'\n+\n+// Waiting for chain backend to finish synchronizing.\n+const NEUTRINO_SYNC_STATUS_WAITING = 'chain-sync-waiting'\n+\n+// Initial sync is currently in progress.\n+const NEUTRINO_SYNC_STATUS_IN_PROGRESS = 'chain-sync-started'\n+\n+// Initial sync has completed.\n+const NEUTRINO_SYNC_STATUS_COMPLETE = 'chain-sync-finished'","path":"app/lnd/lib/neutrino.js","position":14,"original_position":14,"commit_id":"637b27d97d9a0309d4d0ac2ee4f8972d327940a8","original_commit_id":"637b27d97d9a0309d4d0ac2ee4f8972d327940a8","user":{"login":"Empact","id":5470,"node_id":"MDQ6VXNlcjU0NzA=","avatar_url":"https://avatars2.githubusercontent.com/u/5470?v=4","gravatar_id":"","url":"https://api.github.com/users/Empact","html_url":"https://github.com/Empact","followers_url":"https://api.github.com/users/Empact/followers","following_url":"https://api.github.com/users/Empact/following{/other_user}","gists_url":"https://api.github.com/users/Empact/gists{/gist_id}","starred_url":"https://api.github.com/users/Empact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Empact/subscriptions","organizations_url":"https://api.github.com/users/Empact/orgs","repos_url":"https://api.github.com/users/Empact/repos","events_url":"https://api.github.com/users/Empact/events{/privacy}","received_events_url":"https://api.github.com/users/Empact/received_events","type":"User","site_admin":false},"body":"`chain-sync-complete`?","created_at":"2018-07-12T22:37:42Z","updated_at":"2018-07-12T22:37:42Z","html_url":"https://github.com/LN-Zap/zap-desktop/pull/538#discussion_r202199867","pull_request_url":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls/538","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls/comments/202199867"},"html":{"href":"https://github.com/LN-Zap/zap-desktop/pull/538#discussion_r202199867"},"pull_request":{"href":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls/538"}}},"pull_request":{"url":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls/538","id":199768178,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NzY4MTc4","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","issue_url":"https://api.github.com/repos/LN-Zap/zap-desktop/issues/538","number":538,"state":"open","locked":false,"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},"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.","created_at":"2018-07-06T14:44:48Z","updated_at":"2018-07-12T22:37:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d9652a37cb558566a9fe493b9c5089aa6f59d66","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":666128280,"node_id":"MDU6TGFiZWw2NjYxMjgyODA=","url":"https://api.github.com/repos/LN-Zap/zap-desktop/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls/538/commits","review_comments_url":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls/538/comments","review_comment_url":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LN-Zap/zap-desktop/issues/538/comments","statuses_url":"https://api.github.com/repos/LN-Zap/zap-desktop/statuses/637b27d97d9a0309d4d0ac2ee4f8972d327940a8","head":{"label":"mrfelton:feat/handle-btcd-not-synced-case","ref":"feat/handle-btcd-not-synced-case","sha":"637b27d97d9a0309d4d0ac2ee4f8972d327940a8","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},"repo":{"id":124420476,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQ0MjA0NzY=","name":"zap-desktop","full_name":"mrfelton/zap-desktop","owner":{"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},"private":false,"html_url":"https://github.com/mrfelton/zap-desktop","description":"Lightning Network desktop application ","fork":true,"url":"https://api.github.com/repos/mrfelton/zap-desktop","forks_url":"https://api.github.com/repos/mrfelton/zap-desktop/forks","keys_url":"https://api.github.com/repos/mrfelton/zap-desktop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrfelton/zap-desktop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrfelton/zap-desktop/teams","hooks_url":"https://api.github.com/repos/mrfelton/zap-desktop/hooks","issue_events_url":"https://api.github.com/repos/mrfelton/zap-desktop/issues/events{/number}","events_url":"https://api.github.com/repos/mrfelton/zap-desktop/events","assignees_url":"https://api.github.com/repos/mrfelton/zap-desktop/assignees{/user}","branches_url":"https://api.github.com/repos/mrfelton/zap-desktop/branches{/branch}","tags_url":"https://api.github.com/repos/mrfelton/zap-desktop/tags","blobs_url":"https://api.github.com/repos/mrfelton/zap-desktop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrfelton/zap-desktop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrfelton/zap-desktop/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrfelton/zap-desktop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrfelton/zap-desktop/statuses/{sha}","languages_url":"https://api.github.com/repos/mrfelton/zap-desktop/languages","stargazers_url":"https://api.github.com/repos/mrfelton/zap-desktop/stargazers","contributors_url":"https://api.github.com/repos/mrfelton/zap-desktop/contributors","subscribers_url":"https://api.github.com/repos/mrfelton/zap-desktop/subscribers","subscription_url":"https://api.github.com/repos/mrfelton/zap-desktop/subscription","commits_url":"https://api.github.com/repos/mrfelton/zap-desktop/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrfelton/zap-desktop/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrfelton/zap-desktop/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrfelton/zap-desktop/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrfelton/zap-desktop/contents/{+path}","compare_url":"https://api.github.com/repos/mrfelton/zap-desktop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrfelton/zap-desktop/merges","archive_url":"https://api.github.com/repos/mrfelton/zap-desktop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrfelton/zap-desktop/downloads","issues_url":"https://api.github.com/repos/mrfelton/zap-desktop/issues{/number}","pulls_url":"https://api.github.com/repos/mrfelton/zap-desktop/pulls{/number}","milestones_url":"https://api.github.com/repos/mrfelton/zap-desktop/milestones{/number}","notifications_url":"https://api.github.com/repos/mrfelton/zap-desktop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrfelton/zap-desktop/labels{/name}","releases_url":"https://api.github.com/repos/mrfelton/zap-desktop/releases{/id}","deployments_url":"https://api.github.com/repos/mrfelton/zap-desktop/deployments","created_at":"2018-03-08T16:45:15Z","updated_at":"2018-07-05T07:56:51Z","pushed_at":"2018-07-12T22:17:11Z","git_url":"git://github.com/mrfelton/zap-desktop.git","ssh_url":"git@github.com:mrfelton/zap-desktop.git","clone_url":"https://github.com/mrfelton/zap-desktop.git","svn_url":"https://github.com/mrfelton/zap-desktop","homepage":"","size":112129,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"LN-Zap:master","ref":"master","sha":"15a9889d8cc14d1d8cb9c432b94a11739230eab8","user":{"login":"LN-Zap","id":30905490,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwOTA1NDkw","avatar_url":"https://avatars1.githubusercontent.com/u/30905490?v=4","gravatar_id":"","url":"https://api.github.com/users/LN-Zap","html_url":"https://github.com/LN-Zap","followers_url":"https://api.github.com/users/LN-Zap/followers","following_url":"https://api.github.com/users/LN-Zap/following{/other_user}","gists_url":"https://api.github.com/users/LN-Zap/gists{/gist_id}","starred_url":"https://api.github.com/users/LN-Zap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LN-Zap/subscriptions","organizations_url":"https://api.github.com/users/LN-Zap/orgs","repos_url":"https://api.github.com/users/LN-Zap/repos","events_url":"https://api.github.com/users/LN-Zap/events{/privacy}","received_events_url":"https://api.github.com/users/LN-Zap/received_events","type":"Organization","site_admin":false},"repo":{"id":99942301,"node_id":"MDEwOlJlcG9zaXRvcnk5OTk0MjMwMQ==","name":"zap-desktop","full_name":"LN-Zap/zap-desktop","owner":{"login":"LN-Zap","id":30905490,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwOTA1NDkw","avatar_url":"https://avatars1.githubusercontent.com/u/30905490?v=4","gravatar_id":"","url":"https://api.github.com/users/LN-Zap","html_url":"https://github.com/LN-Zap","followers_url":"https://api.github.com/users/LN-Zap/followers","following_url":"https://api.github.com/users/LN-Zap/following{/other_user}","gists_url":"https://api.github.com/users/LN-Zap/gists{/gist_id}","starred_url":"https://api.github.com/users/LN-Zap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LN-Zap/subscriptions","organizations_url":"https://api.github.com/users/LN-Zap/orgs","repos_url":"https://api.github.com/users/LN-Zap/repos","events_url":"https://api.github.com/users/LN-Zap/events{/privacy}","received_events_url":"https://api.github.com/users/LN-Zap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LN-Zap/zap-desktop","description":"Lightning Network desktop application ","fork":false,"url":"https://api.github.com/repos/LN-Zap/zap-desktop","forks_url":"https://api.github.com/repos/LN-Zap/zap-desktop/forks","keys_url":"https://api.github.com/repos/LN-Zap/zap-desktop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LN-Zap/zap-desktop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LN-Zap/zap-desktop/teams","hooks_url":"https://api.github.com/repos/LN-Zap/zap-desktop/hooks","issue_events_url":"https://api.github.com/repos/LN-Zap/zap-desktop/issues/events{/number}","events_url":"https://api.github.com/repos/LN-Zap/zap-desktop/events","assignees_url":"https://api.github.com/repos/LN-Zap/zap-desktop/assignees{/user}","branches_url":"https://api.github.com/repos/LN-Zap/zap-desktop/branches{/branch}","tags_url":"https://api.github.com/repos/LN-Zap/zap-desktop/tags","blobs_url":"https://api.github.com/repos/LN-Zap/zap-desktop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LN-Zap/zap-desktop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LN-Zap/zap-desktop/git/refs{/sha}","trees_url":"https://api.github.com/repos/LN-Zap/zap-desktop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LN-Zap/zap-desktop/statuses/{sha}","languages_url":"https://api.github.com/repos/LN-Zap/zap-desktop/languages","stargazers_url":"https://api.github.com/repos/LN-Zap/zap-desktop/stargazers","contributors_url":"https://api.github.com/repos/LN-Zap/zap-desktop/contributors","subscribers_url":"https://api.github.com/repos/LN-Zap/zap-desktop/subscribers","subscription_url":"https://api.github.com/repos/LN-Zap/zap-desktop/subscription","commits_url":"https://api.github.com/repos/LN-Zap/zap-desktop/commits{/sha}","git_commits_url":"https://api.github.com/repos/LN-Zap/zap-desktop/git/commits{/sha}","comments_url":"https://api.github.com/repos/LN-Zap/zap-desktop/comments{/number}","issue_comment_url":"https://api.github.com/repos/LN-Zap/zap-desktop/issues/comments{/number}","contents_url":"https://api.github.com/repos/LN-Zap/zap-desktop/contents/{+path}","compare_url":"https://api.github.com/repos/LN-Zap/zap-desktop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LN-Zap/zap-desktop/merges","archive_url":"https://api.github.com/repos/LN-Zap/zap-desktop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LN-Zap/zap-desktop/downloads","issues_url":"https://api.github.com/repos/LN-Zap/zap-desktop/issues{/number}","pulls_url":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls{/number}","milestones_url":"https://api.github.com/repos/LN-Zap/zap-desktop/milestones{/number}","notifications_url":"https://api.github.com/repos/LN-Zap/zap-desktop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LN-Zap/zap-desktop/labels{/name}","releases_url":"https://api.github.com/repos/LN-Zap/zap-desktop/releases{/id}","deployments_url":"https://api.github.com/repos/LN-Zap/zap-desktop/deployments","created_at":"2017-08-10T16:14:13Z","updated_at":"2018-07-12T21:53:48Z","pushed_at":"2018-07-12T22:17:12Z","git_url":"git://github.com/LN-Zap/zap-desktop.git","ssh_url":"git@github.com:LN-Zap/zap-desktop.git","clone_url":"https://github.com/LN-Zap/zap-desktop.git","svn_url":"https://github.com/LN-Zap/zap-desktop","homepage":"","size":112201,"stargazers_count":641,"watchers_count":641,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":120,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":120,"open_issues":73,"watchers":641,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls/538"},"html":{"href":"https://github.com/LN-Zap/zap-desktop/pull/538"},"issue":{"href":"https://api.github.com/repos/LN-Zap/zap-desktop/issues/538"},"comments":{"href":"https://api.github.com/repos/LN-Zap/zap-desktop/issues/538/comments"},"review_comments":{"href":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls/538/comments"},"review_comment":{"href":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LN-Zap/zap-desktop/pulls/538/commits"},"statuses":{"href":"https://api.github.com/repos/LN-Zap/zap-desktop/statuses/637b27d97d9a0309d4d0ac2ee4f8972d327940a8"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"Empact"}}