{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/30953622","id":30953622,"diff_hunk":"@@ -160,10 +160,11 @@ void UnregisterNodeSignals(CNodeSignals& nodeSignals);\n  * @param[out]  state   This may be set to an Error state if any error occurred processing it, including during validation/connection/etc of otherwise unrelated blocks during reorganisation; or it may be set to an Invalid state if pblock is itself invalid (but this is not guaranteed even when the block is checked). If you want to *possibly* get feedback on whether pblock is valid, you must also install a CValidationInterface (see validationinterface.h) - this will have its BlockChecked method called whenever *any* block completes validation.\n  * @param[in]   pfrom   The node which we are receiving the block from; it is added to mapBlockSource and may be penalised if the block is invalid.\n  * @param[in]   pblock  The block we want to process.\n+ * @param[in]   fForceProcessing Process this block even if unrequested; used for non-network block sources and whitelisted peers.\n  * @param[out]  dbp     If pblock is stored to disk (or already there), this will be set to its location.\n  * @return True if state.IsValid()\n  */\n-bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp = NULL);\n+bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, bool fForceProcessing, CDiskBlockPos *dbp);","path":"src/main.h","position":9,"original_position":9,"commit_id":"b003c8676dfd051f0e4f0a6866ac4c524d036312","original_commit_id":"b003c8676dfd051f0e4f0a6866ac4c524d036312","user":{"login":"jtimon","id":1008458,"avatar_url":"https://avatars.githubusercontent.com/u/1008458?v=3","gravatar_id":"","url":"https://api.github.com/users/jtimon","html_url":"https://github.com/jtimon","followers_url":"https://api.github.com/users/jtimon/followers","following_url":"https://api.github.com/users/jtimon/following{/other_user}","gists_url":"https://api.github.com/users/jtimon/gists{/gist_id}","starred_url":"https://api.github.com/users/jtimon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtimon/subscriptions","organizations_url":"https://api.github.com/users/jtimon/orgs","repos_url":"https://api.github.com/users/jtimon/repos","events_url":"https://api.github.com/users/jtimon/events{/privacy}","received_events_url":"https://api.github.com/users/jtimon/received_events","type":"User","site_admin":false},"body":"A couple of trivial fixup! commits that don't change behaviour in any way shouldn't delay getting this merged and would make history cleaner by avoiding changing them before (in which case this would be forced to rebase to solve the conflict) or after, since they can be squashed just before merging. Don't feel forced to do it, it would just make this PR nicer.","created_at":"2015-05-24T16:29:08Z","updated_at":"2015-05-24T16:29:08Z","html_url":"https://github.com/bitcoin/bitcoin/pull/5875#discussion_r30953622","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5875","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/30953622"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/5875#discussion_r30953622"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5875"}}},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5875","id":30875082,"html_url":"https://github.com/bitcoin/bitcoin/pull/5875","diff_url":"https://github.com/bitcoin/bitcoin/pull/5875.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/5875.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5875","number":5875,"state":"open","locked":false,"title":"Be stricter in processing unrequested blocks","user":{"login":"sdaftuar","id":7463573,"avatar_url":"https://avatars.githubusercontent.com/u/7463573?v=3","gravatar_id":"","url":"https://api.github.com/users/sdaftuar","html_url":"https://github.com/sdaftuar","followers_url":"https://api.github.com/users/sdaftuar/followers","following_url":"https://api.github.com/users/sdaftuar/following{/other_user}","gists_url":"https://api.github.com/users/sdaftuar/gists{/gist_id}","starred_url":"https://api.github.com/users/sdaftuar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdaftuar/subscriptions","organizations_url":"https://api.github.com/users/sdaftuar/orgs","repos_url":"https://api.github.com/users/sdaftuar/repos","events_url":"https://api.github.com/users/sdaftuar/events{/privacy}","received_events_url":"https://api.github.com/users/sdaftuar/received_events","type":"User","site_admin":false},"body":"The duplicate block handling code in AcceptBlock needed to be updated for autoprune (see #5863 ), since we no longer HAVE_DATA for every block previously processed. This change significantly tightens requirements on which blocks we process, so that the only blocks we process are either ones we've requested (from a network peer or from disk), or are new blocks that also have more work than our tip.\r\n\r\nI believe this is a somewhat substantial behavior change to now link network behavior (ie, whether we've requested a block) to block processing. If we adopt this change, I think it would be easier for us to reduce our reliance on checkpoints in the future.\r\n\r\n[I had been discussing this with @sipa on irc in the context of #5863, but after implementing it I realized that it's actually not tied to autoprune at all and makes more sense to evaluate on its own.]","created_at":"2015-03-10T17:49:32Z","updated_at":"2015-05-24T16:29:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ffd8426be7030e22801f0571d6c8ca9ffe4acc30","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5875/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5875/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5875/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/b003c8676dfd051f0e4f0a6866ac4c524d036312","head":{"label":"sdaftuar:unrequested-block-processing","ref":"unrequested-block-processing","sha":"b003c8676dfd051f0e4f0a6866ac4c524d036312","user":{"login":"sdaftuar","id":7463573,"avatar_url":"https://avatars.githubusercontent.com/u/7463573?v=3","gravatar_id":"","url":"https://api.github.com/users/sdaftuar","html_url":"https://github.com/sdaftuar","followers_url":"https://api.github.com/users/sdaftuar/followers","following_url":"https://api.github.com/users/sdaftuar/following{/other_user}","gists_url":"https://api.github.com/users/sdaftuar/gists{/gist_id}","starred_url":"https://api.github.com/users/sdaftuar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdaftuar/subscriptions","organizations_url":"https://api.github.com/users/sdaftuar/orgs","repos_url":"https://api.github.com/users/sdaftuar/repos","events_url":"https://api.github.com/users/sdaftuar/events{/privacy}","received_events_url":"https://api.github.com/users/sdaftuar/received_events","type":"User","site_admin":false},"repo":{"id":28761781,"name":"bitcoin","full_name":"sdaftuar/bitcoin","owner":{"login":"sdaftuar","id":7463573,"avatar_url":"https://avatars.githubusercontent.com/u/7463573?v=3","gravatar_id":"","url":"https://api.github.com/users/sdaftuar","html_url":"https://github.com/sdaftuar","followers_url":"https://api.github.com/users/sdaftuar/followers","following_url":"https://api.github.com/users/sdaftuar/following{/other_user}","gists_url":"https://api.github.com/users/sdaftuar/gists{/gist_id}","starred_url":"https://api.github.com/users/sdaftuar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdaftuar/subscriptions","organizations_url":"https://api.github.com/users/sdaftuar/orgs","repos_url":"https://api.github.com/users/sdaftuar/repos","events_url":"https://api.github.com/users/sdaftuar/events{/privacy}","received_events_url":"https://api.github.com/users/sdaftuar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sdaftuar/bitcoin","description":"Bitcoin Core integration/staging tree","fork":true,"url":"https://api.github.com/repos/sdaftuar/bitcoin","forks_url":"https://api.github.com/repos/sdaftuar/bitcoin/forks","keys_url":"https://api.github.com/repos/sdaftuar/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sdaftuar/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sdaftuar/bitcoin/teams","hooks_url":"https://api.github.com/repos/sdaftuar/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/sdaftuar/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/sdaftuar/bitcoin/events","assignees_url":"https://api.github.com/repos/sdaftuar/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/sdaftuar/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/sdaftuar/bitcoin/tags","blobs_url":"https://api.github.com/repos/sdaftuar/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sdaftuar/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sdaftuar/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/sdaftuar/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sdaftuar/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/sdaftuar/bitcoin/languages","stargazers_url":"https://api.github.com/repos/sdaftuar/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/sdaftuar/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/sdaftuar/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/sdaftuar/bitcoin/subscription","commits_url":"https://api.github.com/repos/sdaftuar/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/sdaftuar/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/sdaftuar/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/sdaftuar/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/sdaftuar/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/sdaftuar/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sdaftuar/bitcoin/merges","archive_url":"https://api.github.com/repos/sdaftuar/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sdaftuar/bitcoin/downloads","issues_url":"https://api.github.com/repos/sdaftuar/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/sdaftuar/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/sdaftuar/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/sdaftuar/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sdaftuar/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/sdaftuar/bitcoin/releases{/id}","created_at":"2015-01-04T02:52:13Z","updated_at":"2015-04-24T18:52:36Z","pushed_at":"2015-05-22T12:30:34Z","git_url":"git://github.com/sdaftuar/bitcoin.git","ssh_url":"git@github.com:sdaftuar/bitcoin.git","clone_url":"https://github.com/sdaftuar/bitcoin.git","svn_url":"https://github.com/sdaftuar/bitcoin","homepage":"https://bitcoin.org/en/download","size":49431,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bitcoin:master","ref":"master","sha":"0d862c2739b96005fdf0e2a4df347e7291956fc1","user":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars.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://avatars.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}","created_at":"2010-12-19T15:16:43Z","updated_at":"2015-05-24T16:09:40Z","pushed_at":"2015-05-24T08:57:24Z","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":128734,"stargazers_count":6911,"watchers_count":6911,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4813,"mirror_url":null,"open_issues_count":420,"forks":4813,"open_issues":420,"watchers":6911,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5875"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/5875"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/5875"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/5875/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5875/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5875/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/b003c8676dfd051f0e4f0a6866ac4c524d036312"}}}}