{"action":"created","issue":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/14803","repository_url":"https://api.github.com/repos/bitcoin/bitcoin","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/14803/labels{/name}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/14803/comments","events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/14803/events","html_url":"https://github.com/bitcoin/bitcoin/pull/14803","id":384130879,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNDA4NTQ5","number":14803,"title":"consensus: Avoid data race in CBlock class","user":{"login":"hebasto","id":32963518,"node_id":"MDQ6VXNlcjMyOTYzNTE4","avatar_url":"https://avatars1.githubusercontent.com/u/32963518?v=4","gravatar_id":"","url":"https://api.github.com/users/hebasto","html_url":"https://github.com/hebasto","followers_url":"https://api.github.com/users/hebasto/followers","following_url":"https://api.github.com/users/hebasto/following{/other_user}","gists_url":"https://api.github.com/users/hebasto/gists{/gist_id}","starred_url":"https://api.github.com/users/hebasto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hebasto/subscriptions","organizations_url":"https://api.github.com/users/hebasto/orgs","repos_url":"https://api.github.com/users/hebasto/repos","events_url":"https://api.github.com/users/hebasto/events{/privacy}","received_events_url":"https://api.github.com/users/hebasto/received_events","type":"User","site_admin":false},"labels":[{"id":192202000,"node_id":"MDU6TGFiZWwxOTIyMDIwMDA=","url":"https://api.github.com/repos/bitcoin/bitcoin/labels/Consensus","name":"Consensus","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-11-25T23:25:16Z","updated_at":"2018-11-27T22:12:27Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/14803","html_url":"https://github.com/bitcoin/bitcoin/pull/14803","diff_url":"https://github.com/bitcoin/bitcoin/pull/14803.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/14803.patch"},"body":"Ref: #14058, #14072 \r\n\r\nCheckBlock can be invoked from multiple threads in parallel. To avoid a data race `std::atomic<bool>` is used.\r\nAll comments from #14072 are addressed.\r\n\r\nAs this PR introduces copy constructors for both `CBlockHeader` and `CBlock` classes, additional refactoring proposed for `CBlock::GetBlockHeader()`."},"comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments/442237566","html_url":"https://github.com/bitcoin/bitcoin/pull/14803#issuecomment-442237566","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/14803","id":442237566,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjIzNzU2Ng==","user":{"login":"MarcoFalke","id":6399679,"node_id":"MDQ6VXNlcjYzOTk2Nzk=","avatar_url":"https://avatars0.githubusercontent.com/u/6399679?v=4","gravatar_id":"","url":"https://api.github.com/users/MarcoFalke","html_url":"https://github.com/MarcoFalke","followers_url":"https://api.github.com/users/MarcoFalke/followers","following_url":"https://api.github.com/users/MarcoFalke/following{/other_user}","gists_url":"https://api.github.com/users/MarcoFalke/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoFalke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoFalke/subscriptions","organizations_url":"https://api.github.com/users/MarcoFalke/orgs","repos_url":"https://api.github.com/users/MarcoFalke/repos","events_url":"https://api.github.com/users/MarcoFalke/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoFalke/received_events","type":"User","site_admin":false},"created_at":"2018-11-27T22:12:27Z","updated_at":"2018-11-27T22:12:27Z","author_association":"MEMBER","body":"> Why doesn't the lock on the block index or even cs main prevent concurrency here?\r\n\r\nThe cs main lock was moved down in this change \"Harden against mistakes handling invalid blocks\" #9765  by @sdaftuar \r\n\r\nSo unless there was a reason to not put it before `CheckBlock`, I suggest to move it up by one line.\r\n"}}
{"actor":{"display_login":"MarcoFalke"}}