{"action":"created","issue":{"url":"https://api.github.com/repos/lightningnetwork/lnd/issues/364","repository_url":"https://api.github.com/repos/lightningnetwork/lnd","labels_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/364/labels{/name}","comments_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/364/comments","events_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/364/events","html_url":"https://github.com/lightningnetwork/lnd/pull/364","id":262139867,"number":364,"title":"ChannelRouter and graph re-org awareness","user":{"login":"halseth","id":3765732,"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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-10-02T16:13:16Z","updated_at":"2017-10-20T14:00:04Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/364","html_url":"https://github.com/lightningnetwork/lnd/pull/364","diff_url":"https://github.com/lightningnetwork/lnd/pull/364.diff","patch_url":"https://github.com/lightningnetwork/lnd/pull/364.patch"},"body":"This PR makes the channel router re-org aware, by making the router handle stale blocks delivered from the chain view. The channel graph now gets support for \"reverse pruning\", through the method `DisconnectBlockAtHeight`. This method will remove edges from the channel graph that gets \"negative confirmations\" because of a reorg, leaving the database in a state consistent with the best height the router is aware of.\r\n\r\n### blockEventQueue\r\nThis PR also introduces a new queue implementation for ordered block events, modeled after the `htlcswitch`'s `packetQueue`. This is used to ensure the notifications about connected/disconnected blocks from the chain view is handled by the router in the correct order.\r\n\r\n### Tests\r\nSeveral tests are added to ensure the re-org awareness is working as expected in the affected parts of the code:\r\n`router`\r\n`channeldb`\r\n`routing/chainview`\r\n`lnd_test`\r\n\r\n~~NB: Needs a fix for https://github.com/lightninglabs/neutrino/pull/18 for all tests to be able to pass.~~ Fixed\r\n\r\nCloses #270."},"comment":{"url":"https://api.github.com/repos/lightningnetwork/lnd/issues/comments/338214968","html_url":"https://github.com/lightningnetwork/lnd/pull/364#issuecomment-338214968","issue_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/364","id":338214968,"user":{"login":"halseth","id":3765732,"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},"created_at":"2017-10-20T14:00:04Z","updated_at":"2017-10-20T14:00:04Z","author_association":"COLLABORATOR","body":"Addressed comments + fixed a bug where I would break out of the `switch` instead of the `loop` in `syncChannelWithGraph`. I changed it so that we just `return nil` at this point, since that's what is done if you the graph is in the \"not-pruned\" state at the start of the method. \r\n\r\nPTAL"}}
{"actor":{"display_login":"halseth"}}