{"action":"created","comment":{"url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/comments/228019383","pull_request_review_id":168191143,"id":228019383,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODAxOTM4Mw==","diff_hunk":"@@ -1990,6 +1990,19 @@ func (s *Switch) getLinkByShortID(chanID lnwire.ShortChannelID) (ChannelLink, er\n \treturn link, nil\n }\n \n+// ActiveLinks returns a list of ChannelLinks currently active within the\n+// switch.\n+func (s *Switch) ActiveLinks() []ChannelLink {\n+\ts.indexMtx.RLock()\n+\tdefer s.indexMtx.RUnlock()\n+\n+\tvar links []ChannelLink\n+\tfor _, l := range s.linkIndex {\n+\t\tlinks = append(links, l)","path":"htlcswitch/switch.go","position":12,"original_position":12,"commit_id":"cdcf292f91e9e9e7f86291c673460e1ddd49e8e0","original_commit_id":"98b92b4ffb5646405eae3af66b8be841234e7da4","user":{"login":"halseth","id":3765732,"node_id":"MDQ6VXNlcjM3NjU3MzI=","avatar_url":"https://avatars1.githubusercontent.com/u/3765732?v=4","gravatar_id":"","url":"https://api.github.com/users/halseth","html_url":"https://github.com/halseth","followers_url":"https://api.github.com/users/halseth/followers","following_url":"https://api.github.com/users/halseth/following{/other_user}","gists_url":"https://api.github.com/users/halseth/gists{/gist_id}","starred_url":"https://api.github.com/users/halseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halseth/subscriptions","organizations_url":"https://api.github.com/users/halseth/orgs","repos_url":"https://api.github.com/users/halseth/repos","events_url":"https://api.github.com/users/halseth/events{/privacy}","received_events_url":"https://api.github.com/users/halseth/received_events","type":"User","site_admin":false},"body":"Ah, good idea! Should the same filtering be done for `HasActiveLink` below?","created_at":"2018-10-25T02:45:50Z","updated_at":"2018-10-25T02:45:50Z","html_url":"https://github.com/lightningnetwork/lnd/pull/2091#discussion_r228019383","pull_request_url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/2091","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/lightningnetwork/lnd/pulls/comments/228019383"},"html":{"href":"https://github.com/lightningnetwork/lnd/pull/2091#discussion_r228019383"},"pull_request":{"href":"https://api.github.com/repos/lightningnetwork/lnd/pulls/2091"}},"in_reply_to_id":227961370},"pull_request":{"url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/2091","id":225547650,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1NTQ3NjUw","html_url":"https://github.com/lightningnetwork/lnd/pull/2091","diff_url":"https://github.com/lightningnetwork/lnd/pull/2091.diff","patch_url":"https://github.com/lightningnetwork/lnd/pull/2091.patch","issue_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/2091","number":2091,"state":"open","locked":false,"title":"Strict channel enabling","user":{"login":"halseth","id":3765732,"node_id":"MDQ6VXNlcjM3NjU3MzI=","avatar_url":"https://avatars1.githubusercontent.com/u/3765732?v=4","gravatar_id":"","url":"https://api.github.com/users/halseth","html_url":"https://github.com/halseth","followers_url":"https://api.github.com/users/halseth/followers","following_url":"https://api.github.com/users/halseth/following{/other_user}","gists_url":"https://api.github.com/users/halseth/gists{/gist_id}","starred_url":"https://api.github.com/users/halseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halseth/subscriptions","organizations_url":"https://api.github.com/users/halseth/orgs","repos_url":"https://api.github.com/users/halseth/repos","events_url":"https://api.github.com/users/halseth/events{/privacy}","received_events_url":"https://api.github.com/users/halseth/received_events","type":"User","site_admin":false},"body":"This PR enables strict channel enabling in `lnd`. This means that similarly to how we disable channels, we require a disabled link to stay active for 20 minutes (default) before re-enabling it.\r\n\r\nThis is done in two steps:\r\n1. The path finding algorithm is modified to take into account an extra set of active local channels, that it will use when considering whether to ignore local channels. This improves the current path finding logic when using `mission control`, as we will no longer attempt to route over local channels that are inactive.\r\n2. The channel re-enabling logic carried out when a peer connects is removed, as we will now instead let the server's re-enabling logic take care of enabling the disabled channels when they have been stable for 20 minutes.\r\n\r\nThis essentially decouples the graph's disabled status from the local path finding, as the local channel status will be more up-to-date than what is found in the graph.\r\n\r\nReplaces https://github.com/lightningnetwork/lnd/pull/2080","created_at":"2018-10-24T20:55:21Z","updated_at":"2018-10-25T02:45:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0720972ae81fb5972603cfdb7f447861b2efc67e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/2091/commits","review_comments_url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/2091/comments","review_comment_url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/2091/comments","statuses_url":"https://api.github.com/repos/lightningnetwork/lnd/statuses/cdcf292f91e9e9e7f86291c673460e1ddd49e8e0","head":{"label":"halseth:strict-channel-enable","ref":"strict-channel-enable","sha":"cdcf292f91e9e9e7f86291c673460e1ddd49e8e0","user":{"login":"halseth","id":3765732,"node_id":"MDQ6VXNlcjM3NjU3MzI=","avatar_url":"https://avatars1.githubusercontent.com/u/3765732?v=4","gravatar_id":"","url":"https://api.github.com/users/halseth","html_url":"https://github.com/halseth","followers_url":"https://api.github.com/users/halseth/followers","following_url":"https://api.github.com/users/halseth/following{/other_user}","gists_url":"https://api.github.com/users/halseth/gists{/gist_id}","starred_url":"https://api.github.com/users/halseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halseth/subscriptions","organizations_url":"https://api.github.com/users/halseth/orgs","repos_url":"https://api.github.com/users/halseth/repos","events_url":"https://api.github.com/users/halseth/events{/privacy}","received_events_url":"https://api.github.com/users/halseth/received_events","type":"User","site_admin":false},"repo":{"id":86519132,"node_id":"MDEwOlJlcG9zaXRvcnk4NjUxOTEzMg==","name":"lnd","full_name":"halseth/lnd","private":false,"owner":{"login":"halseth","id":3765732,"node_id":"MDQ6VXNlcjM3NjU3MzI=","avatar_url":"https://avatars1.githubusercontent.com/u/3765732?v=4","gravatar_id":"","url":"https://api.github.com/users/halseth","html_url":"https://github.com/halseth","followers_url":"https://api.github.com/users/halseth/followers","following_url":"https://api.github.com/users/halseth/following{/other_user}","gists_url":"https://api.github.com/users/halseth/gists{/gist_id}","starred_url":"https://api.github.com/users/halseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halseth/subscriptions","organizations_url":"https://api.github.com/users/halseth/orgs","repos_url":"https://api.github.com/users/halseth/repos","events_url":"https://api.github.com/users/halseth/events{/privacy}","received_events_url":"https://api.github.com/users/halseth/received_events","type":"User","site_admin":false},"html_url":"https://github.com/halseth/lnd","description":"Lightning Network Daemon ⚡️","fork":true,"url":"https://api.github.com/repos/halseth/lnd","forks_url":"https://api.github.com/repos/halseth/lnd/forks","keys_url":"https://api.github.com/repos/halseth/lnd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/halseth/lnd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/halseth/lnd/teams","hooks_url":"https://api.github.com/repos/halseth/lnd/hooks","issue_events_url":"https://api.github.com/repos/halseth/lnd/issues/events{/number}","events_url":"https://api.github.com/repos/halseth/lnd/events","assignees_url":"https://api.github.com/repos/halseth/lnd/assignees{/user}","branches_url":"https://api.github.com/repos/halseth/lnd/branches{/branch}","tags_url":"https://api.github.com/repos/halseth/lnd/tags","blobs_url":"https://api.github.com/repos/halseth/lnd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/halseth/lnd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/halseth/lnd/git/refs{/sha}","trees_url":"https://api.github.com/repos/halseth/lnd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/halseth/lnd/statuses/{sha}","languages_url":"https://api.github.com/repos/halseth/lnd/languages","stargazers_url":"https://api.github.com/repos/halseth/lnd/stargazers","contributors_url":"https://api.github.com/repos/halseth/lnd/contributors","subscribers_url":"https://api.github.com/repos/halseth/lnd/subscribers","subscription_url":"https://api.github.com/repos/halseth/lnd/subscription","commits_url":"https://api.github.com/repos/halseth/lnd/commits{/sha}","git_commits_url":"https://api.github.com/repos/halseth/lnd/git/commits{/sha}","comments_url":"https://api.github.com/repos/halseth/lnd/comments{/number}","issue_comment_url":"https://api.github.com/repos/halseth/lnd/issues/comments{/number}","contents_url":"https://api.github.com/repos/halseth/lnd/contents/{+path}","compare_url":"https://api.github.com/repos/halseth/lnd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/halseth/lnd/merges","archive_url":"https://api.github.com/repos/halseth/lnd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/halseth/lnd/downloads","issues_url":"https://api.github.com/repos/halseth/lnd/issues{/number}","pulls_url":"https://api.github.com/repos/halseth/lnd/pulls{/number}","milestones_url":"https://api.github.com/repos/halseth/lnd/milestones{/number}","notifications_url":"https://api.github.com/repos/halseth/lnd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/halseth/lnd/labels{/name}","releases_url":"https://api.github.com/repos/halseth/lnd/releases{/id}","deployments_url":"https://api.github.com/repos/halseth/lnd/deployments","created_at":"2017-03-29T00:00:37Z","updated_at":"2018-10-25T02:24:17Z","pushed_at":"2018-10-25T02:24:15Z","git_url":"git://github.com/halseth/lnd.git","ssh_url":"git@github.com:halseth/lnd.git","clone_url":"https://github.com/halseth/lnd.git","svn_url":"https://github.com/halseth/lnd","homepage":"","size":23508,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":1,"watchers":3,"default_branch":"master"}},"base":{"label":"lightningnetwork:master","ref":"master","sha":"1b0d8e8f13359d361cd957d2a18bf8d2801c6c86","user":{"login":"lightningnetwork","id":13424735,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDI0NzM1","avatar_url":"https://avatars0.githubusercontent.com/u/13424735?v=4","gravatar_id":"","url":"https://api.github.com/users/lightningnetwork","html_url":"https://github.com/lightningnetwork","followers_url":"https://api.github.com/users/lightningnetwork/followers","following_url":"https://api.github.com/users/lightningnetwork/following{/other_user}","gists_url":"https://api.github.com/users/lightningnetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/lightningnetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightningnetwork/subscriptions","organizations_url":"https://api.github.com/users/lightningnetwork/orgs","repos_url":"https://api.github.com/users/lightningnetwork/repos","events_url":"https://api.github.com/users/lightningnetwork/events{/privacy}","received_events_url":"https://api.github.com/users/lightningnetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":49765480,"node_id":"MDEwOlJlcG9zaXRvcnk0OTc2NTQ4MA==","name":"lnd","full_name":"lightningnetwork/lnd","private":false,"owner":{"login":"lightningnetwork","id":13424735,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDI0NzM1","avatar_url":"https://avatars0.githubusercontent.com/u/13424735?v=4","gravatar_id":"","url":"https://api.github.com/users/lightningnetwork","html_url":"https://github.com/lightningnetwork","followers_url":"https://api.github.com/users/lightningnetwork/followers","following_url":"https://api.github.com/users/lightningnetwork/following{/other_user}","gists_url":"https://api.github.com/users/lightningnetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/lightningnetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightningnetwork/subscriptions","organizations_url":"https://api.github.com/users/lightningnetwork/orgs","repos_url":"https://api.github.com/users/lightningnetwork/repos","events_url":"https://api.github.com/users/lightningnetwork/events{/privacy}","received_events_url":"https://api.github.com/users/lightningnetwork/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/lightningnetwork/lnd","description":"Lightning Network Daemon ⚡️","fork":false,"url":"https://api.github.com/repos/lightningnetwork/lnd","forks_url":"https://api.github.com/repos/lightningnetwork/lnd/forks","keys_url":"https://api.github.com/repos/lightningnetwork/lnd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lightningnetwork/lnd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lightningnetwork/lnd/teams","hooks_url":"https://api.github.com/repos/lightningnetwork/lnd/hooks","issue_events_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/events{/number}","events_url":"https://api.github.com/repos/lightningnetwork/lnd/events","assignees_url":"https://api.github.com/repos/lightningnetwork/lnd/assignees{/user}","branches_url":"https://api.github.com/repos/lightningnetwork/lnd/branches{/branch}","tags_url":"https://api.github.com/repos/lightningnetwork/lnd/tags","blobs_url":"https://api.github.com/repos/lightningnetwork/lnd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lightningnetwork/lnd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lightningnetwork/lnd/git/refs{/sha}","trees_url":"https://api.github.com/repos/lightningnetwork/lnd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lightningnetwork/lnd/statuses/{sha}","languages_url":"https://api.github.com/repos/lightningnetwork/lnd/languages","stargazers_url":"https://api.github.com/repos/lightningnetwork/lnd/stargazers","contributors_url":"https://api.github.com/repos/lightningnetwork/lnd/contributors","subscribers_url":"https://api.github.com/repos/lightningnetwork/lnd/subscribers","subscription_url":"https://api.github.com/repos/lightningnetwork/lnd/subscription","commits_url":"https://api.github.com/repos/lightningnetwork/lnd/commits{/sha}","git_commits_url":"https://api.github.com/repos/lightningnetwork/lnd/git/commits{/sha}","comments_url":"https://api.github.com/repos/lightningnetwork/lnd/comments{/number}","issue_comment_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/comments{/number}","contents_url":"https://api.github.com/repos/lightningnetwork/lnd/contents/{+path}","compare_url":"https://api.github.com/repos/lightningnetwork/lnd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lightningnetwork/lnd/merges","archive_url":"https://api.github.com/repos/lightningnetwork/lnd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lightningnetwork/lnd/downloads","issues_url":"https://api.github.com/repos/lightningnetwork/lnd/issues{/number}","pulls_url":"https://api.github.com/repos/lightningnetwork/lnd/pulls{/number}","milestones_url":"https://api.github.com/repos/lightningnetwork/lnd/milestones{/number}","notifications_url":"https://api.github.com/repos/lightningnetwork/lnd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lightningnetwork/lnd/labels{/name}","releases_url":"https://api.github.com/repos/lightningnetwork/lnd/releases{/id}","deployments_url":"https://api.github.com/repos/lightningnetwork/lnd/deployments","created_at":"2016-01-16T08:19:33Z","updated_at":"2018-10-25T00:54:39Z","pushed_at":"2018-10-25T02:35:15Z","git_url":"git://github.com/lightningnetwork/lnd.git","ssh_url":"git@github.com:lightningnetwork/lnd.git","clone_url":"https://github.com/lightningnetwork/lnd.git","svn_url":"https://github.com/lightningnetwork/lnd","homepage":"","size":21148,"stargazers_count":3153,"watchers_count":3153,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":796,"mirror_url":null,"archived":false,"open_issues_count":294,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":796,"open_issues":294,"watchers":3153,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lightningnetwork/lnd/pulls/2091"},"html":{"href":"https://github.com/lightningnetwork/lnd/pull/2091"},"issue":{"href":"https://api.github.com/repos/lightningnetwork/lnd/issues/2091"},"comments":{"href":"https://api.github.com/repos/lightningnetwork/lnd/issues/2091/comments"},"review_comments":{"href":"https://api.github.com/repos/lightningnetwork/lnd/pulls/2091/comments"},"review_comment":{"href":"https://api.github.com/repos/lightningnetwork/lnd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lightningnetwork/lnd/pulls/2091/commits"},"statuses":{"href":"https://api.github.com/repos/lightningnetwork/lnd/statuses/cdcf292f91e9e9e7f86291c673460e1ddd49e8e0"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"halseth"}}