{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/28444588","id":28444588,"diff_hunk":"@@ -78,17 +80,33 @@ class TxPriorityCompare\n     }\n };\n \n+uint32_t GetNextWorkRequiredLog(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& consensusParams)\n+{\n+    uint32_t nextChallenge = GetNextWorkRequired(pindexLast, pblock, consensusParams, GetPrevIndex);\n+    /// debug print\n+    LogPrintf(\"GetNextWorkRequired RETARGET\\n\");","path":"src/miner.cpp","position":24,"original_position":24,"commit_id":"f0860464ad8566db98c58b86ec5679d802cf8225","original_commit_id":"f0860464ad8566db98c58b86ec5679d802cf8225","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":"I don't undesrtand what you mean. There's two functions with this, one for miner and one for everyone else. I'm happy to remove the miner version if it's fine to remove the logging there.\r\nAnyway, I will create a smaller PR only adapting the pow functions to consensus.","created_at":"2015-04-15T17:52:56Z","updated_at":"2015-04-15T17:52:56Z","html_url":"https://github.com/bitcoin/bitcoin/pull/5995#discussion_r28444588","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5995","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/28444588"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/5995#discussion_r28444588"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5995"}}},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5995","id":33051910,"html_url":"https://github.com/bitcoin/bitcoin/pull/5995","diff_url":"https://github.com/bitcoin/bitcoin/pull/5995.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/5995.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5995","number":5995,"state":"open","locked":false,"title":"DEPENDENT: API: Expose bitcoinconsensus_verify_header() in libconsensus","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":"To extend libconsensus' functionality, I propose to add ```bitcoinconsensus_verify_header()``` the partial checks ```CheckBlockHeader()``` and ```ContextualCheckBlockHeader``` could be exposed as well.\r\n\r\nUnlike VerifyScript, VerifyBlockHeader depends on the nodes storage, as it requires data from the blockchain previous to the header being verified. How to exactly interface that data with VerifyBlockHeader can be a delicate matter and it should be of course open to discussion. Here there's just one proposal.\r\n\r\nThe offending dependency is CBlockIndex in chain.o, specially CBlockIndex::pprev which is a pointer to another object. All the other dependencies unacceptable for libconsensus have been removed first, to make things easier for someone who wants to propose to solve that final problem in some other way.\r\n\r\nDependencies:\r\n-Consensus preparations #5669\r\n-Chainparams: Refactor: Decouple IsSuperMajority from Params() #5968\r\n-Consensus: Decouple ContextualCheckBlockHeader from checkpoints #5975\r\n-Consensus: Turn CBlockIndex::GetMedianTimePast into independent function #6009\r\n","created_at":"2015-04-10T14:33:26Z","updated_at":"2015-04-15T17:52:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1493227916e545329cd71bfa84d333c71cc299ea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5995/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5995/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5995/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/f0860464ad8566db98c58b86ec5679d802cf8225","head":{"label":"jtimon:consensus_header","ref":"consensus_header","sha":"f0860464ad8566db98c58b86ec5679d802cf8225","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}","created_at":"2014-03-07T06:02:15Z","updated_at":"2014-07-27T14:54:19Z","pushed_at":"2015-04-15T17:36:37Z","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":49112,"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":"ea2b425b00b01b5b6670fa39488caf146dac4642","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-04-15T14:14:24Z","pushed_at":"2015-04-15T17:40:45Z","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":115641,"stargazers_count":6744,"watchers_count":6744,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4720,"mirror_url":null,"open_issues_count":466,"forks":4720,"open_issues":466,"watchers":6744,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5995"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/5995"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/5995"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/5995/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5995/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5995/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/f0860464ad8566db98c58b86ec5679d802cf8225"}}}}