{"action":"created","issue":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13558","repository_url":"https://api.github.com/repos/bitcoin/bitcoin","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13558/labels{/name}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13558/comments","events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13558/events","html_url":"https://github.com/bitcoin/bitcoin/pull/13558","id":336474582,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3OTE4NTYz","number":13558,"title":"Drop unused GetType() from CSizeComputer","user":{"login":"Empact","id":5470,"node_id":"MDQ6VXNlcjU0NzA=","avatar_url":"https://avatars2.githubusercontent.com/u/5470?v=4","gravatar_id":"","url":"https://api.github.com/users/Empact","html_url":"https://github.com/Empact","followers_url":"https://api.github.com/users/Empact/followers","following_url":"https://api.github.com/users/Empact/following{/other_user}","gists_url":"https://api.github.com/users/Empact/gists{/gist_id}","starred_url":"https://api.github.com/users/Empact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Empact/subscriptions","organizations_url":"https://api.github.com/users/Empact/orgs","repos_url":"https://api.github.com/users/Empact/repos","events_url":"https://api.github.com/users/Empact/events{/privacy}","received_events_url":"https://api.github.com/users/Empact/received_events","type":"User","site_admin":false},"labels":[{"id":135961,"node_id":"MDU6TGFiZWwxMzU5NjE=","url":"https://api.github.com/repos/bitcoin/bitcoin/labels/Refactoring","name":"Refactoring","color":"E6F6D6","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-06-28T05:08:55Z","updated_at":"2018-10-06T01:32:04Z","closed_at":"2018-09-11T07:30:41Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13558","html_url":"https://github.com/bitcoin/bitcoin/pull/13558","diff_url":"https://github.com/bitcoin/bitcoin/pull/13558.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/13558.patch"},"body":"Based on conversation in #13462, it seems the serialization `GetType` has very narrow use/effect. In every case except for `CAddress`, which specifically relates to a network peer's address, not a wallet address etc., the serialized representation of an object is irrespective of its destination / type.\r\n\r\nThis removes the unused `GetType` method from `CSizeComputer` as a step to further narrowing that use."},"comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments/427536116","html_url":"https://github.com/bitcoin/bitcoin/pull/13558#issuecomment-427536116","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13558","id":427536116,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzUzNjExNg==","user":{"login":"kallewoof","id":250224,"node_id":"MDQ6VXNlcjI1MDIyNA==","avatar_url":"https://avatars3.githubusercontent.com/u/250224?v=4","gravatar_id":"","url":"https://api.github.com/users/kallewoof","html_url":"https://github.com/kallewoof","followers_url":"https://api.github.com/users/kallewoof/followers","following_url":"https://api.github.com/users/kallewoof/following{/other_user}","gists_url":"https://api.github.com/users/kallewoof/gists{/gist_id}","starred_url":"https://api.github.com/users/kallewoof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kallewoof/subscriptions","organizations_url":"https://api.github.com/users/kallewoof/orgs","repos_url":"https://api.github.com/users/kallewoof/repos","events_url":"https://api.github.com/users/kallewoof/events{/privacy}","received_events_url":"https://api.github.com/users/kallewoof/received_events","type":"User","site_admin":false},"created_at":"2018-10-06T01:32:04Z","updated_at":"2018-10-06T01:32:04Z","author_association":"MEMBER","body":"@Empact Can you give hints on how to fix the below? Code no longer compiles..\r\n\r\n```C++\r\n    template <typename Stream, typename Operation>\r\n    inline void SerializationOp(Stream& s, Operation ser_action) {\r\n        READWRITE(this->nVersion);\r\n        READWRITE(hashPrevBlock);\r\n        READWRITE(hashMerkleRoot);\r\n        READWRITE(nTime);\r\n        READWRITE(nBits);\r\n        READWRITE(nNonce);\r\n        if (g_solution_blocks && !(s.GetType() & SER_GETHASH)) {\r\n            READWRITE(g_blockheader_payload_map[GetHash()]);\r\n            size_t len = GetSizeOfCompactSize(g_blockheader_payload_map[GetHash()].size()) + g_blockheader_payload_map[GetHash()].size();\r\n            while (len < g_solution_block_len) {\r\n                uint8_t padding = 0;\r\n                READWRITE(padding);\r\n                len++;\r\n            }\r\n        }\r\n    }\r\n```\r\n"}}
{"actor":{"display_login":"kallewoof"}}