{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/22823206","id":22823206,"diff_hunk":"@@ -3347,30 +3511,36 @@ void static ProcessGetData(CNode* pfrom)\n                 {\n                     // Send block from disk\n                     CBlock block;\n-                    if (!ReadBlockFromDisk(block, (*mi).second))\n-                        assert(!\"cannot load block from disk\");\n-                    if (inv.type == MSG_BLOCK)\n-                        pfrom->PushMessage(\"block\", block);\n-                    else // MSG_FILTERED_BLOCK)\n-                    {\n-                        LOCK(pfrom->cs_filter);\n-                        if (pfrom->pfilter)\n-                        {\n-                            CMerkleBlock merkleBlock(block, *pfrom->pfilter);\n-                            pfrom->PushMessage(\"merkleblock\", merkleBlock);\n-                            // CMerkleBlock just contains hashes, so also push any transactions in the block the client did not see\n-                            // This avoids hurting performance by pointlessly requiring a round-trip\n-                            // Note that there is currently no way for a node to request any single transactions we didnt send here -\n-                            // they must either disconnect and retry or request the full block.\n-                            // Thus, the protocol spec specified allows for us to provide duplicate txn here,\n-                            // however we MUST always provide at least what the remote peer needs\n-                            typedef std::pair<unsigned int, uint256> PairType;\n-                            BOOST_FOREACH(PairType& pair, merkleBlock.vMatchedTxn)\n-                                if (!pfrom->setInventoryKnown.count(CInv(MSG_TX, pair.second)))\n-                                    pfrom->PushMessage(\"tx\", block.vtx[pair.first]);\n+                    if (!ReadBlockFromDisk(block, (*mi).second)) {","path":"src/main.cpp","position":278,"original_position":278,"commit_id":"bbb769c5c1d7c13f1edc11de3209da10184897d5","original_commit_id":"bbb769c5c1d7c13f1edc11de3209da10184897d5","user":{"login":"theuni","id":417043,"avatar_url":"https://avatars.githubusercontent.com/u/417043?v=3","gravatar_id":"","url":"https://api.github.com/users/theuni","html_url":"https://github.com/theuni","followers_url":"https://api.github.com/users/theuni/followers","following_url":"https://api.github.com/users/theuni/following{/other_user}","gists_url":"https://api.github.com/users/theuni/gists{/gist_id}","starred_url":"https://api.github.com/users/theuni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theuni/subscriptions","organizations_url":"https://api.github.com/users/theuni/orgs","repos_url":"https://api.github.com/users/theuni/repos","events_url":"https://api.github.com/users/theuni/events{/privacy}","received_events_url":"https://api.github.com/users/theuni/received_events","type":"User","site_admin":false},"body":"It seems this doesn't make the distinction between missing a pruned block and a failed read. If a non-pruned block fails to read when pruning is enabled, shouldn't we fail as before?\r\n\r\nAlternatively.. couldn't the pruning check happen before ReadBlockFromDisk(), to avoid the overhead entirely for pruned nodes? If we're comfortable with randomly answering with a notfound, why not do it constantly?","created_at":"2015-01-12T21:19:27Z","updated_at":"2015-01-12T21:19:27Z","html_url":"https://github.com/bitcoin/bitcoin/pull/4701#discussion_r22823206","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/4701","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/22823206"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/4701#discussion_r22823206"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/4701"}}},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/4701","id":19811552,"html_url":"https://github.com/bitcoin/bitcoin/pull/4701","diff_url":"https://github.com/bitcoin/bitcoin/pull/4701.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/4701.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/4701","number":4701,"state":"open","locked":false,"title":"Autoprune","user":{"login":"rdponticelli","id":1192483,"avatar_url":"https://avatars.githubusercontent.com/u/1192483?v=3","gravatar_id":"","url":"https://api.github.com/users/rdponticelli","html_url":"https://github.com/rdponticelli","followers_url":"https://api.github.com/users/rdponticelli/followers","following_url":"https://api.github.com/users/rdponticelli/following{/other_user}","gists_url":"https://api.github.com/users/rdponticelli/gists{/gist_id}","starred_url":"https://api.github.com/users/rdponticelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdponticelli/subscriptions","organizations_url":"https://api.github.com/users/rdponticelli/orgs","repos_url":"https://api.github.com/users/rdponticelli/repos","events_url":"https://api.github.com/users/rdponticelli/events{/privacy}","received_events_url":"https://api.github.com/users/rdponticelli/received_events","type":"User","site_admin":false},"body":"This pull implements a new mode of operation which automatically removes old block files trying to maintain at most a maximum amount of disk space used by the node. This amount is configured by the user with the -prune switch.\r\n\r\nThere's also a lightweight sanity check which executes periodically during runtime to make sure the minimum block files required for the node to be operative are present.\r\n\r\nThis should allow to lower the amount of resources needed to run a node.\r\n\r\nSee the individual commits, about all the changes introduced.","created_at":"2014-08-14T20:09:54Z","updated_at":"2015-01-12T21:19:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b11b9009e73096dce39b77751cd53b42239e00e9","assignee":null,"milestone":{"url":"https://api.github.com/repos/bitcoin/bitcoin/milestones/18","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones/18/labels","id":818033,"number":18,"title":"0.11.0","description":"","creator":{"login":"laanwj","id":126646,"avatar_url":"https://avatars.githubusercontent.com/u/126646?v=3","gravatar_id":"","url":"https://api.github.com/users/laanwj","html_url":"https://github.com/laanwj","followers_url":"https://api.github.com/users/laanwj/followers","following_url":"https://api.github.com/users/laanwj/following{/other_user}","gists_url":"https://api.github.com/users/laanwj/gists{/gist_id}","starred_url":"https://api.github.com/users/laanwj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laanwj/subscriptions","organizations_url":"https://api.github.com/users/laanwj/orgs","repos_url":"https://api.github.com/users/laanwj/repos","events_url":"https://api.github.com/users/laanwj/events{/privacy}","received_events_url":"https://api.github.com/users/laanwj/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":2,"state":"open","created_at":"2014-10-08T08:27:24Z","updated_at":"2015-01-08T13:26:05Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/4701/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/4701/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/{number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/4701/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/bbb769c5c1d7c13f1edc11de3209da10184897d5","head":{"label":"Criptomonedas:autoprune","ref":"autoprune","sha":"bbb769c5c1d7c13f1edc11de3209da10184897d5","user":{"login":"Criptomonedas","id":2457522,"avatar_url":"https://avatars.githubusercontent.com/u/2457522?v=3","gravatar_id":"","url":"https://api.github.com/users/Criptomonedas","html_url":"https://github.com/Criptomonedas","followers_url":"https://api.github.com/users/Criptomonedas/followers","following_url":"https://api.github.com/users/Criptomonedas/following{/other_user}","gists_url":"https://api.github.com/users/Criptomonedas/gists{/gist_id}","starred_url":"https://api.github.com/users/Criptomonedas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Criptomonedas/subscriptions","organizations_url":"https://api.github.com/users/Criptomonedas/orgs","repos_url":"https://api.github.com/users/Criptomonedas/repos","events_url":"https://api.github.com/users/Criptomonedas/events{/privacy}","received_events_url":"https://api.github.com/users/Criptomonedas/received_events","type":"Organization","site_admin":false},"repo":{"id":6246883,"name":"bitcoin","full_name":"Criptomonedas/bitcoin","owner":{"login":"Criptomonedas","id":2457522,"avatar_url":"https://avatars.githubusercontent.com/u/2457522?v=3","gravatar_id":"","url":"https://api.github.com/users/Criptomonedas","html_url":"https://github.com/Criptomonedas","followers_url":"https://api.github.com/users/Criptomonedas/followers","following_url":"https://api.github.com/users/Criptomonedas/following{/other_user}","gists_url":"https://api.github.com/users/Criptomonedas/gists{/gist_id}","starred_url":"https://api.github.com/users/Criptomonedas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Criptomonedas/subscriptions","organizations_url":"https://api.github.com/users/Criptomonedas/orgs","repos_url":"https://api.github.com/users/Criptomonedas/repos","events_url":"https://api.github.com/users/Criptomonedas/events{/privacy}","received_events_url":"https://api.github.com/users/Criptomonedas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Criptomonedas/bitcoin","description":"Bitcoin integration/staging tree","fork":true,"url":"https://api.github.com/repos/Criptomonedas/bitcoin","forks_url":"https://api.github.com/repos/Criptomonedas/bitcoin/forks","keys_url":"https://api.github.com/repos/Criptomonedas/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Criptomonedas/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Criptomonedas/bitcoin/teams","hooks_url":"https://api.github.com/repos/Criptomonedas/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/Criptomonedas/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/Criptomonedas/bitcoin/events","assignees_url":"https://api.github.com/repos/Criptomonedas/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/Criptomonedas/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/Criptomonedas/bitcoin/tags","blobs_url":"https://api.github.com/repos/Criptomonedas/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Criptomonedas/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Criptomonedas/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/Criptomonedas/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Criptomonedas/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/Criptomonedas/bitcoin/languages","stargazers_url":"https://api.github.com/repos/Criptomonedas/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/Criptomonedas/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/Criptomonedas/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/Criptomonedas/bitcoin/subscription","commits_url":"https://api.github.com/repos/Criptomonedas/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/Criptomonedas/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/Criptomonedas/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/Criptomonedas/bitcoin/issues/comments/{number}","contents_url":"https://api.github.com/repos/Criptomonedas/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/Criptomonedas/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Criptomonedas/bitcoin/merges","archive_url":"https://api.github.com/repos/Criptomonedas/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Criptomonedas/bitcoin/downloads","issues_url":"https://api.github.com/repos/Criptomonedas/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/Criptomonedas/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/Criptomonedas/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/Criptomonedas/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Criptomonedas/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/Criptomonedas/bitcoin/releases{/id}","created_at":"2012-10-16T15:44:14Z","updated_at":"2014-12-02T23:37:05Z","pushed_at":"2015-01-12T17:58:16Z","git_url":"git://github.com/Criptomonedas/bitcoin.git","ssh_url":"git@github.com:Criptomonedas/bitcoin.git","clone_url":"https://github.com/Criptomonedas/bitcoin.git","svn_url":"https://github.com/Criptomonedas/bitcoin","homepage":"http://www.bitcoin.org","size":39518,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","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":1,"default_branch":"master"}},"base":{"label":"bitcoin:master","ref":"master","sha":"90c71548c795787b008bc337cb9332f75d1bccdb","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-01-12T20:41:17Z","pushed_at":"2015-01-12T15:20:58Z","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":106048,"stargazers_count":6330,"watchers_count":6330,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4572,"mirror_url":null,"open_issues_count":429,"forks":4572,"open_issues":429,"watchers":6330,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/4701"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/4701"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/4701"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/4701/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/4701/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/4701/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/bbb769c5c1d7c13f1edc11de3209da10184897d5"}}}}