{"action":"created","issue":{"url":"https://api.github.com/repos/lightningnetwork/lnd/issues/751","repository_url":"https://api.github.com/repos/lightningnetwork/lnd","labels_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/751/labels{/name}","comments_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/751/comments","events_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/751/events","html_url":"https://github.com/lightningnetwork/lnd/pull/751","id":296062418,"number":751,"title":"Remove txindex requirement for full nodes","user":{"login":"wilmerpaulino","id":9447167,"avatar_url":"https://avatars0.githubusercontent.com/u/9447167?v=4","gravatar_id":"","url":"https://api.github.com/users/wilmerpaulino","html_url":"https://github.com/wilmerpaulino","followers_url":"https://api.github.com/users/wilmerpaulino/followers","following_url":"https://api.github.com/users/wilmerpaulino/following{/other_user}","gists_url":"https://api.github.com/users/wilmerpaulino/gists{/gist_id}","starred_url":"https://api.github.com/users/wilmerpaulino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilmerpaulino/subscriptions","organizations_url":"https://api.github.com/users/wilmerpaulino/orgs","repos_url":"https://api.github.com/users/wilmerpaulino/repos","events_url":"https://api.github.com/users/wilmerpaulino/events{/privacy}","received_events_url":"https://api.github.com/users/wilmerpaulino/received_events","type":"User","site_admin":false},"labels":[{"id":833751432,"url":"https://api.github.com/repos/lightningnetwork/lnd/labels/backend","name":"backend","color":"7e62ba","default":false},{"id":778122131,"url":"https://api.github.com/repos/lightningnetwork/lnd/labels/channels","name":"channels","color":"4c42a5","default":false},{"id":431232839,"url":"https://api.github.com/repos/lightningnetwork/lnd/labels/funding","name":"funding","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-10T01:46:41Z","updated_at":"2018-02-12T06:11:12Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/751","html_url":"https://github.com/lightningnetwork/lnd/pull/751","diff_url":"https://github.com/lightningnetwork/lnd/pull/751.diff","patch_url":"https://github.com/lightningnetwork/lnd/pull/751.patch"},"body":"Fixes #527.\r\n\r\nSo far, `lnd` has required its backend `btcd` and `bitcoind` full nodes to enable the transaction index. It is used to retrieve details for transaction confirmations and/or already spent transactions. This PR aims to remove that requirement by introducing some fallback methods, in the event that the transaction index is not enabled.\r\n\r\nWhen attempting to retrieve these details, we now have the following workflow:\r\n\r\n1. We attempt to look up transactions using the transaction index.\r\n2. If the transaction index is not enabled, we attempt to look up transactions by manually scanning the chain's blocks starting from the earliest height where the transaction could have been included in, to the current height.\r\n3. In the case of pruned nodes, some of these blocks that we tried to scan above might have been missing because the node discarded them. Therefore, we decide to fetch these blocks from the node's peers and scan them.\r\n\r\nI've also added some unit tests to make sure each part of the workflow above works as expected.\r\n\r\nIt's important to get this right, so it would be really helpful if people could spin up this patch locally on one of their test nodes and see how things go.\r\n\r\nThis depends on https://github.com/Roasbeef/btcwallet/pull/14, so you'll either need to pull that locally as well or make the changes yourself within the `vendor` directory (very minor).\r\n\r\nI realize there's a lot of code duplication, it might be worth looking into how to refactor some of these things. That's probably out of scope for this PR though."},"comment":{"url":"https://api.github.com/repos/lightningnetwork/lnd/issues/comments/364836273","html_url":"https://github.com/lightningnetwork/lnd/pull/751#issuecomment-364836273","issue_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/751","id":364836273,"user":{"login":"wilmerpaulino","id":9447167,"avatar_url":"https://avatars0.githubusercontent.com/u/9447167?v=4","gravatar_id":"","url":"https://api.github.com/users/wilmerpaulino","html_url":"https://github.com/wilmerpaulino","followers_url":"https://api.github.com/users/wilmerpaulino/followers","following_url":"https://api.github.com/users/wilmerpaulino/following{/other_user}","gists_url":"https://api.github.com/users/wilmerpaulino/gists{/gist_id}","starred_url":"https://api.github.com/users/wilmerpaulino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilmerpaulino/subscriptions","organizations_url":"https://api.github.com/users/wilmerpaulino/orgs","repos_url":"https://api.github.com/users/wilmerpaulino/repos","events_url":"https://api.github.com/users/wilmerpaulino/events{/privacy}","received_events_url":"https://api.github.com/users/wilmerpaulino/received_events","type":"User","site_admin":false},"created_at":"2018-02-12T06:11:12Z","updated_at":"2018-02-12T06:11:12Z","author_association":"CONTRIBUTOR","body":"Looks like to fully support pruned nodes, we'll also have to cover some parts in the `routing/chainview` and `lnwallet/btcwallet` packages.\r\n\r\n@Roasbeef, should I open a new PR to address this?"}}
{"actor":{"display_login":"wilmerpaulino"}}