{"action":"created","issue":{"url":"https://api.github.com/repos/monero-project/monero/issues/1266","repository_url":"https://api.github.com/repos/monero-project/monero","labels_url":"https://api.github.com/repos/monero-project/monero/issues/1266/labels{/name}","comments_url":"https://api.github.com/repos/monero-project/monero/issues/1266/comments","events_url":"https://api.github.com/repos/monero-project/monero/issues/1266/events","html_url":"https://github.com/monero-project/monero/pull/1266","id":185791295,"number":1266,"title":"Can't check genesis block of empty blockchain","user":{"login":"hyc","id":306354,"avatar_url":"https://avatars.githubusercontent.com/u/306354?v=3","gravatar_id":"","url":"https://api.github.com/users/hyc","html_url":"https://github.com/hyc","followers_url":"https://api.github.com/users/hyc/followers","following_url":"https://api.github.com/users/hyc/following{/other_user}","gists_url":"https://api.github.com/users/hyc/gists{/gist_id}","starred_url":"https://api.github.com/users/hyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyc/subscriptions","organizations_url":"https://api.github.com/users/hyc/orgs","repos_url":"https://api.github.com/users/hyc/repos","events_url":"https://api.github.com/users/hyc/events{/privacy}","received_events_url":"https://api.github.com/users/hyc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-27T22:00:37Z","updated_at":"2016-10-27T22:24:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/monero-project/monero/pulls/1266","html_url":"https://github.com/monero-project/monero/pull/1266","diff_url":"https://github.com/monero-project/monero/pull/1266.diff","patch_url":"https://github.com/monero-project/monero/pull/1266.patch"},"body":"Fix Issue#1235"},"comment":{"url":"https://api.github.com/repos/monero-project/monero/issues/comments/256787241","html_url":"https://github.com/monero-project/monero/pull/1266#issuecomment-256787241","issue_url":"https://api.github.com/repos/monero-project/monero/issues/1266","id":256787241,"user":{"login":"hyc","id":306354,"avatar_url":"https://avatars.githubusercontent.com/u/306354?v=3","gravatar_id":"","url":"https://api.github.com/users/hyc","html_url":"https://github.com/hyc","followers_url":"https://api.github.com/users/hyc/followers","following_url":"https://api.github.com/users/hyc/following{/other_user}","gists_url":"https://api.github.com/users/hyc/gists{/gist_id}","starred_url":"https://api.github.com/users/hyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyc/subscriptions","organizations_url":"https://api.github.com/users/hyc/orgs","repos_url":"https://api.github.com/users/hyc/repos","events_url":"https://api.github.com/users/hyc/events{/privacy}","received_events_url":"https://api.github.com/users/hyc/received_events","type":"User","site_admin":false},"created_at":"2016-10-27T22:24:36Z","updated_at":"2016-10-27T22:24:36Z","body":"OK, looking at this in a larger context, it makes no sense at all, my patch shouldn't have been necessary or had any effect. And yet it does.\r\n\r\n      crypto::hash genesis_hash = get_block_hash(genesis);\r\n\r\n      if (m_blockchain.empty())\r\n      {\r\n        m_blockchain.push_back(genesis_hash);\r\n      }\r\n      else\r\n      {\r\n        check_genesis(genesis_hash);\r\n      }\r\n\r\n      m_local_bc_height = m_blockchain.size();\r\n    }\r\n    //----------------------------------------------------------------------------------------------------\r\n    void wallet2::check_genesis(const crypto::hash& genesis_hash) const {\r\n      std::string what(\"Genesis block missmatch. You probably use wallet without testnet flag with blockchain from test network or vice versa\");\r\n    \r\n      THROW_WALLET_EXCEPTION_IF(m_blockchain.size() && genesis_hash != m_blockchain[0], error::wallet_internal_error, what);\r\n    }\r\n\r\nI see no other callers of check_genesis(). WTF?"}}
{"actor":{"display_login":"hyc"}}