{"action":"created","issue":{"url":"https://api.github.com/repos/petertodd/python-bitcoinlib/issues/130","repository_url":"https://api.github.com/repos/petertodd/python-bitcoinlib","labels_url":"https://api.github.com/repos/petertodd/python-bitcoinlib/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/petertodd/python-bitcoinlib/issues/130/comments","events_url":"https://api.github.com/repos/petertodd/python-bitcoinlib/issues/130/events","html_url":"https://github.com/petertodd/python-bitcoinlib/pull/130","id":193761947,"number":130,"title":"Serialize msg_header using CBlockHeader instead of CBlock","user":{"login":"str4d","id":4993799,"avatar_url":"https://avatars0.githubusercontent.com/u/4993799?v=4","gravatar_id":"","url":"https://api.github.com/users/str4d","html_url":"https://github.com/str4d","followers_url":"https://api.github.com/users/str4d/followers","following_url":"https://api.github.com/users/str4d/following{/other_user}","gists_url":"https://api.github.com/users/str4d/gists{/gist_id}","starred_url":"https://api.github.com/users/str4d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/str4d/subscriptions","organizations_url":"https://api.github.com/users/str4d/orgs","repos_url":"https://api.github.com/users/str4d/repos","events_url":"https://api.github.com/users/str4d/events{/privacy}","received_events_url":"https://api.github.com/users/str4d/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-06T12:37:27Z","updated_at":"2017-08-23T19:59:33Z","closed_at":"2017-08-23T19:59:26Z","pull_request":{"url":"https://api.github.com/repos/petertodd/python-bitcoinlib/pulls/130","html_url":"https://github.com/petertodd/python-bitcoinlib/pull/130","diff_url":"https://github.com/petertodd/python-bitcoinlib/pull/130.diff","patch_url":"https://github.com/petertodd/python-bitcoinlib/pull/130.patch"},"body":"This resolves an issue I uncovered while updating `pynode` to work with `python-bitcoinlib` 0.7.0. The following usage was previously allowable, because `CBlock` was mutable:\r\n\r\n```py\r\ndb_block = self.chaindb.getblock(blkhash)\r\nblock = copy.copy(db_block)\r\nblock.vtx = []\r\nmsg.headers.append(block)\r\n```\r\n\r\nI [updated it](https://github.com/jgarzik/pynode/pull/19/files#diff-97b3827045a89ffba8170a14179aeb74L373) to the following, which resulted in the type error that this PR fixes:\r\n\r\n```py\r\nblock = self.chaindb.getblock(blkhash)\r\nmsg.headers.append(block.get_header())\r\n```"},"comment":{"url":"https://api.github.com/repos/petertodd/python-bitcoinlib/issues/comments/324445645","html_url":"https://github.com/petertodd/python-bitcoinlib/pull/130#issuecomment-324445645","issue_url":"https://api.github.com/repos/petertodd/python-bitcoinlib/issues/130","id":324445645,"user":{"login":"petertodd","id":7042,"avatar_url":"https://avatars2.githubusercontent.com/u/7042?v=4","gravatar_id":"","url":"https://api.github.com/users/petertodd","html_url":"https://github.com/petertodd","followers_url":"https://api.github.com/users/petertodd/followers","following_url":"https://api.github.com/users/petertodd/following{/other_user}","gists_url":"https://api.github.com/users/petertodd/gists{/gist_id}","starred_url":"https://api.github.com/users/petertodd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petertodd/subscriptions","organizations_url":"https://api.github.com/users/petertodd/orgs","repos_url":"https://api.github.com/users/petertodd/repos","events_url":"https://api.github.com/users/petertodd/events{/privacy}","received_events_url":"https://api.github.com/users/petertodd/received_events","type":"User","site_admin":false},"created_at":"2017-08-23T19:59:33Z","updated_at":"2017-08-23T19:59:33Z","body":"Thanks!"}}
{"actor":{"display_login":"petertodd"}}