{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/51284256","id":51284256,"diff_hunk":"@@ -2954,24 +2950,20 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo\n \n     // Size limits\n     if (block.vtx.empty() || block.vtx.size() > MAX_BLOCK_SIZE || ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE)\n-        return state.DoS(100, error(\"CheckBlock(): size limits failed\"),\n-                         REJECT_INVALID, \"bad-blk-length\");\n+        return state.DoS(100, false, REJECT_INVALID, \"bad-blk-length\", false, \"size limits failed\");\n \n     // First transaction must be coinbase, the rest must not be\n     if (block.vtx.empty() || !block.vtx[0].IsCoinBase())\n-        return state.DoS(100, error(\"CheckBlock(): first tx is not coinbase\"),\n-                         REJECT_INVALID, \"bad-cb-missing\");\n+        return state.DoS(100, false, REJECT_INVALID, \"bad-cb-missing\", false, \"first tx is not coinbase\");\n     for (unsigned int i = 1; i < block.vtx.size(); i++)\n         if (block.vtx[i].IsCoinBase())\n-            return state.DoS(100, error(\"CheckBlock(): more than one coinbase\"),\n-                             REJECT_INVALID, \"bad-cb-multiple\");\n+            return state.DoS(100, false, REJECT_INVALID, \"bad-cb-multiple\", false, \"more than one coinbase\");\n \n     // Check transactions\n     BOOST_FOREACH(const CTransaction& tx, block.vtx)\n         if (!CheckTransaction(tx, state))\n-            return error(\"CheckBlock(): CheckTransaction of %s failed with %s\",\n-                tx.GetHash().ToString(),\n-                FormatStateMessage(state));\n+            return state.Invalid(false, state.GetRejectCode(), state.GetRejectReason(),\n+                                 strprintf(\"Transaction check failed (tx hash %s)\", tx.GetHash().ToString(), state.GetDebugMessage()));","path":"src/main.cpp","position":101,"original_position":101,"commit_id":"8d777437c0c4e7fbd9957300c53998854dc7c32a","original_commit_id":"8d777437c0c4e7fbd9957300c53998854dc7c32a","user":{"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},"body":"strprintf: Only one %s, but two arguments","created_at":"2016-01-29T16:50:30Z","updated_at":"2016-01-29T16:50:30Z","html_url":"https://github.com/bitcoin/bitcoin/pull/7287#discussion_r51284256","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7287","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/51284256"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/7287#discussion_r51284256"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7287"}}},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7287","id":54977619,"html_url":"https://github.com/bitcoin/bitcoin/pull/7287","diff_url":"https://github.com/bitcoin/bitcoin/pull/7287.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/7287.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/7287","number":7287,"state":"open","locked":false,"title":"Consensus: Remove calls to error() and FormatStateMessage()","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":"Remove calls to error() and FormatStateMessage() ~~and FormatMoney()~~ from some consensus code in main.\r\n\r\nThis is necessary because libconsensus cannot depend on util.cpp, which exposes globals among other things. Doing this before moving this consensus code out of main allows consensus/consensus.cpp to never depend on util.cpp and it removes the necessity to make FormatStateMessage() non-static to call it, temporarily, from consensus/consensus.cpp.\r\n\r\nThis also restores some error reporting that seems to have been lost, maybe while moving to use FormatStateMessage().","created_at":"2016-01-04T14:03:39Z","updated_at":"2016-01-29T16:50:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a6cead1352d3668167a893afd481cb155e19588c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7287/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7287/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/7287/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/8d777437c0c4e7fbd9957300c53998854dc7c32a","head":{"label":"jtimon:consensus-decouple-util-0.13.99","ref":"consensus-decouple-util-0.13.99","sha":"8d777437c0c4e7fbd9957300c53998854dc7c32a","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},"repo":{"id":17504501,"name":"bitcoin","full_name":"jtimon/bitcoin","owner":{"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},"private":false,"html_url":"https://github.com/jtimon/bitcoin","description":"Bitcoin Core integration/staging tree","fork":true,"url":"https://api.github.com/repos/jtimon/bitcoin","forks_url":"https://api.github.com/repos/jtimon/bitcoin/forks","keys_url":"https://api.github.com/repos/jtimon/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jtimon/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jtimon/bitcoin/teams","hooks_url":"https://api.github.com/repos/jtimon/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/jtimon/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/jtimon/bitcoin/events","assignees_url":"https://api.github.com/repos/jtimon/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/jtimon/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/jtimon/bitcoin/tags","blobs_url":"https://api.github.com/repos/jtimon/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jtimon/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jtimon/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jtimon/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jtimon/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/jtimon/bitcoin/languages","stargazers_url":"https://api.github.com/repos/jtimon/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/jtimon/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/jtimon/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/jtimon/bitcoin/subscription","commits_url":"https://api.github.com/repos/jtimon/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jtimon/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jtimon/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jtimon/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jtimon/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/jtimon/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jtimon/bitcoin/merges","archive_url":"https://api.github.com/repos/jtimon/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jtimon/bitcoin/downloads","issues_url":"https://api.github.com/repos/jtimon/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/jtimon/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/jtimon/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/jtimon/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jtimon/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/jtimon/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/jtimon/bitcoin/deployments","created_at":"2014-03-07T06:02:15Z","updated_at":"2014-07-27T14:54:19Z","pushed_at":"2016-01-29T15:27:36Z","git_url":"git://github.com/jtimon/bitcoin.git","ssh_url":"git@github.com:jtimon/bitcoin.git","clone_url":"https://github.com/jtimon/bitcoin.git","svn_url":"https://github.com/jtimon/bitcoin","homepage":"https://bitcoin.org/en/download","size":63346,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"bitcoin:master","ref":"master","sha":"019280617aad7008e523e0bbe19cd76fd59d5e25","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}","deployments_url":"https://api.github.com/repos/bitcoin/bitcoin/deployments","created_at":"2010-12-19T15:16:43Z","updated_at":"2016-01-29T16:28:35Z","pushed_at":"2016-01-29T15:27:38Z","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":128104,"stargazers_count":8420,"watchers_count":8420,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":5702,"mirror_url":null,"open_issues_count":427,"forks":5702,"open_issues":427,"watchers":8420,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7287"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/7287"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/7287"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/7287/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7287/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7287/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/8d777437c0c4e7fbd9957300c53998854dc7c32a"}}}}