{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/118579994","pull_request_review_id":40386873,"id":118579994,"diff_hunk":"@@ -167,8 +167,8 @@ bool CDB::Recover(const std::string& filename, void *callbackDataIn, bool (*reco\n     // Call Salvage with fAggressive=true to\n     // get as much data as possible.\n     // Rewrite salvaged data to fresh wallet file\n-    // Set -rescan so any missing transactions will be\n-    // found.\n+    // call rescanblockchain (RPC) so any missing","path":"src/wallet/db.cpp","position":6,"original_position":6,"commit_id":"0092c0662c3daea6b9c9ef10028216b0aac37a78","original_commit_id":"6217140cfe35a209359e1d70d38397c5f0a7ba73","user":{"login":"jnewbery","id":1063656,"avatar_url":"https://avatars0.githubusercontent.com/u/1063656?v=3","gravatar_id":"","url":"https://api.github.com/users/jnewbery","html_url":"https://github.com/jnewbery","followers_url":"https://api.github.com/users/jnewbery/followers","following_url":"https://api.github.com/users/jnewbery/following{/other_user}","gists_url":"https://api.github.com/users/jnewbery/gists{/gist_id}","starred_url":"https://api.github.com/users/jnewbery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnewbery/subscriptions","organizations_url":"https://api.github.com/users/jnewbery/orgs","repos_url":"https://api.github.com/users/jnewbery/repos","events_url":"https://api.github.com/users/jnewbery/events{/privacy}","received_events_url":"https://api.github.com/users/jnewbery/received_events","type":"User","site_admin":false},"body":"ah, makes sense now. Thank you. I wasn't looking in init.cpp, but now I think I see how this fits together. CWallet::Verify() is called first, which calls CWalletDB::Recover() if `-salvagewallet` is set. Later in AppInitMain(), we call CWallet::AppInitMain(), which is where the rescan happens if `-salvagewallet` is set.\r\n\r\nPerhaps change the comment to something like:\r\n\r\n```\r\n    // Try to recover the wallet:\r\n    // - move wallet file to wallet.timestamp.bak\r\n    // - call Salvage with fAggressive=true to get as much data as possible.\r\n    // - rewrite salvaged data to fresh wallet file\r\n    //\r\n    // CWallet::AppInitMain() will later run a full blockchain rescan to find\r\n    // any missing transactions.\r\n```","created_at":"2017-05-25T20:42:00Z","updated_at":"2017-05-25T20:42:00Z","html_url":"https://github.com/bitcoin/bitcoin/pull/7061#discussion_r118579994","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7061","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/118579994"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/7061#discussion_r118579994"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7061"}}},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7061","id":51234232,"html_url":"https://github.com/bitcoin/bitcoin/pull/7061","diff_url":"https://github.com/bitcoin/bitcoin/pull/7061.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/7061.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/7061","number":7061,"state":"open","locked":false,"title":"[Wallet] Replace -rescan with a new RPC call \"rescanblockchain\"","user":{"login":"jonasschnelli","id":178464,"avatar_url":"https://avatars0.githubusercontent.com/u/178464?v=3","gravatar_id":"","url":"https://api.github.com/users/jonasschnelli","html_url":"https://github.com/jonasschnelli","followers_url":"https://api.github.com/users/jonasschnelli/followers","following_url":"https://api.github.com/users/jonasschnelli/following{/other_user}","gists_url":"https://api.github.com/users/jonasschnelli/gists{/gist_id}","starred_url":"https://api.github.com/users/jonasschnelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonasschnelli/subscriptions","organizations_url":"https://api.github.com/users/jonasschnelli/orgs","repos_url":"https://api.github.com/users/jonasschnelli/repos","events_url":"https://api.github.com/users/jonasschnelli/events{/privacy}","received_events_url":"https://api.github.com/users/jonasschnelli/received_events","type":"User","site_admin":false},"body":"A RPC rescan command is much more flexible for the following reasons:\r\n* You can define the start and end-height\r\n* It can be called during runtime\r\n* It can work in multiwallet environment","created_at":"2015-11-19T15:10:15Z","updated_at":"2017-05-25T20:42:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"009d799a2cf5e65f071de639fc04f8b1fef4081c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7061/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7061/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/7061/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/0092c0662c3daea6b9c9ef10028216b0aac37a78","head":{"label":"jonasschnelli:2015/11/wallet_rescan_rpc","ref":"2015/11/wallet_rescan_rpc","sha":"0092c0662c3daea6b9c9ef10028216b0aac37a78","user":{"login":"jonasschnelli","id":178464,"avatar_url":"https://avatars0.githubusercontent.com/u/178464?v=3","gravatar_id":"","url":"https://api.github.com/users/jonasschnelli","html_url":"https://github.com/jonasschnelli","followers_url":"https://api.github.com/users/jonasschnelli/followers","following_url":"https://api.github.com/users/jonasschnelli/following{/other_user}","gists_url":"https://api.github.com/users/jonasschnelli/gists{/gist_id}","starred_url":"https://api.github.com/users/jonasschnelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonasschnelli/subscriptions","organizations_url":"https://api.github.com/users/jonasschnelli/orgs","repos_url":"https://api.github.com/users/jonasschnelli/repos","events_url":"https://api.github.com/users/jonasschnelli/events{/privacy}","received_events_url":"https://api.github.com/users/jonasschnelli/received_events","type":"User","site_admin":false},"repo":{"id":9264454,"name":"bitcoin","full_name":"jonasschnelli/bitcoin","owner":{"login":"jonasschnelli","id":178464,"avatar_url":"https://avatars0.githubusercontent.com/u/178464?v=3","gravatar_id":"","url":"https://api.github.com/users/jonasschnelli","html_url":"https://github.com/jonasschnelli","followers_url":"https://api.github.com/users/jonasschnelli/followers","following_url":"https://api.github.com/users/jonasschnelli/following{/other_user}","gists_url":"https://api.github.com/users/jonasschnelli/gists{/gist_id}","starred_url":"https://api.github.com/users/jonasschnelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonasschnelli/subscriptions","organizations_url":"https://api.github.com/users/jonasschnelli/orgs","repos_url":"https://api.github.com/users/jonasschnelli/repos","events_url":"https://api.github.com/users/jonasschnelli/events{/privacy}","received_events_url":"https://api.github.com/users/jonasschnelli/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jonasschnelli/bitcoin","description":"CoreWallet development branch - A better full node wallet for bitcoin-core","fork":true,"url":"https://api.github.com/repos/jonasschnelli/bitcoin","forks_url":"https://api.github.com/repos/jonasschnelli/bitcoin/forks","keys_url":"https://api.github.com/repos/jonasschnelli/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonasschnelli/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonasschnelli/bitcoin/teams","hooks_url":"https://api.github.com/repos/jonasschnelli/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/jonasschnelli/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/jonasschnelli/bitcoin/events","assignees_url":"https://api.github.com/repos/jonasschnelli/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/jonasschnelli/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/jonasschnelli/bitcoin/tags","blobs_url":"https://api.github.com/repos/jonasschnelli/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonasschnelli/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonasschnelli/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonasschnelli/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonasschnelli/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/jonasschnelli/bitcoin/languages","stargazers_url":"https://api.github.com/repos/jonasschnelli/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/jonasschnelli/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/jonasschnelli/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/jonasschnelli/bitcoin/subscription","commits_url":"https://api.github.com/repos/jonasschnelli/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonasschnelli/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonasschnelli/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonasschnelli/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonasschnelli/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/jonasschnelli/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonasschnelli/bitcoin/merges","archive_url":"https://api.github.com/repos/jonasschnelli/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonasschnelli/bitcoin/downloads","issues_url":"https://api.github.com/repos/jonasschnelli/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/jonasschnelli/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/jonasschnelli/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/jonasschnelli/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonasschnelli/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/jonasschnelli/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/jonasschnelli/bitcoin/deployments","created_at":"2013-04-06T18:21:51Z","updated_at":"2016-01-11T12:21:57Z","pushed_at":"2017-05-25T07:12:23Z","git_url":"git://github.com/jonasschnelli/bitcoin.git","ssh_url":"git@github.com:jonasschnelli/bitcoin.git","clone_url":"https://github.com/jonasschnelli/bitcoin.git","svn_url":"https://github.com/jonasschnelli/bitcoin","homepage":"http://www.bitcoin.org","size":82780,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"2015/05/corewallet"}},"base":{"label":"bitcoin:master","ref":"master","sha":"4314544d46e8e46c3c9da60f1d18297f52f58418","user":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars1.githubusercontent.com/u/528860?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"repo":{"id":1181927,"name":"bitcoin","full_name":"bitcoin/bitcoin","owner":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars1.githubusercontent.com/u/528860?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoin/bitcoin","description":"Bitcoin Core integration/staging tree","fork":false,"url":"https://api.github.com/repos/bitcoin/bitcoin","forks_url":"https://api.github.com/repos/bitcoin/bitcoin/forks","keys_url":"https://api.github.com/repos/bitcoin/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoin/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoin/bitcoin/teams","hooks_url":"https://api.github.com/repos/bitcoin/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoin/bitcoin/events","assignees_url":"https://api.github.com/repos/bitcoin/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoin/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoin/bitcoin/tags","blobs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoin/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoin/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoin/bitcoin/languages","stargazers_url":"https://api.github.com/repos/bitcoin/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/bitcoin/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/bitcoin/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/bitcoin/bitcoin/subscription","commits_url":"https://api.github.com/repos/bitcoin/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoin/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoin/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoin/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoin/bitcoin/merges","archive_url":"https://api.github.com/repos/bitcoin/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoin/bitcoin/downloads","issues_url":"https://api.github.com/repos/bitcoin/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoin/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/bitcoin/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/bitcoin/bitcoin/deployments","created_at":"2010-12-19T15:16:43Z","updated_at":"2017-05-25T20:29:52Z","pushed_at":"2017-05-25T20:05:26Z","git_url":"git://github.com/bitcoin/bitcoin.git","ssh_url":"git@github.com:bitcoin/bitcoin.git","clone_url":"https://github.com/bitcoin/bitcoin.git","svn_url":"https://github.com/bitcoin/bitcoin","homepage":"https://bitcoin.org/en/download","size":83128,"stargazers_count":12802,"watchers_count":12802,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":8257,"mirror_url":null,"open_issues_count":667,"forks":8257,"open_issues":667,"watchers":12802,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7061"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/7061"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/7061"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/7061/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7061/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7061/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/0092c0662c3daea6b9c9ef10028216b0aac37a78"}}}}
{"actor":{"display_login":"jnewbery"}}