{"action":"created","issue":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/16345","repository_url":"https://api.github.com/repos/bitcoin/bitcoin","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/16345/labels{/name}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/16345/comments","events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/16345/events","html_url":"https://github.com/bitcoin/bitcoin/pull/16345","id":464720320,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjk0OTQwNTUw","number":16345,"title":"RPC: Add getblockbyheight","user":{"login":"emilengler","id":12272949,"node_id":"MDQ6VXNlcjEyMjcyOTQ5","avatar_url":"https://avatars3.githubusercontent.com/u/12272949?v=4","gravatar_id":"","url":"https://api.github.com/users/emilengler","html_url":"https://github.com/emilengler","followers_url":"https://api.github.com/users/emilengler/followers","following_url":"https://api.github.com/users/emilengler/following{/other_user}","gists_url":"https://api.github.com/users/emilengler/gists{/gist_id}","starred_url":"https://api.github.com/users/emilengler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilengler/subscriptions","organizations_url":"https://api.github.com/users/emilengler/orgs","repos_url":"https://api.github.com/users/emilengler/repos","events_url":"https://api.github.com/users/emilengler/events{/privacy}","received_events_url":"https://api.github.com/users/emilengler/received_events","type":"User","site_admin":false},"labels":[{"id":98279177,"node_id":"MDU6TGFiZWw5ODI3OTE3Nw==","url":"https://api.github.com/repos/bitcoin/bitcoin/labels/RPC/REST/ZMQ","name":"RPC/REST/ZMQ","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2019-07-05T17:16:35Z","updated_at":"2019-07-06T13:30:59Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/16345","html_url":"https://github.com/bitcoin/bitcoin/pull/16345","diff_url":"https://github.com/bitcoin/bitcoin/pull/16345.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/16345.patch"},"body":"As such a feature get requested a lot (#16317, #14858 and #8457), I've implemented it into a **new** RPC call called `getblockbyheight` as it was discussed in #16163 \r\nIn the past this feature got requested for the `getblock` command but it isn't a good idea to interpret a string as a number because it breaks API consistency.\r\n\r\nThe function is basically just a duplicate of `getblock` with the exception that it gets the hash by the height (first parameter) and not by the hash as a parameter.\r\n\r\nIt also checks if the block exists by comparing the height with the total height or if the block is negative.\r\n\r\nEDIT: I improved the code with the help of @fqlx so it no longer contains some of the getblock legacy."},"comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments/508926760","html_url":"https://github.com/bitcoin/bitcoin/pull/16345#issuecomment-508926760","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/16345","id":508926760,"node_id":"MDEyOklzc3VlQ29tbWVudDUwODkyNjc2MA==","user":{"login":"emilengler","id":12272949,"node_id":"MDQ6VXNlcjEyMjcyOTQ5","avatar_url":"https://avatars3.githubusercontent.com/u/12272949?v=4","gravatar_id":"","url":"https://api.github.com/users/emilengler","html_url":"https://github.com/emilengler","followers_url":"https://api.github.com/users/emilengler/followers","following_url":"https://api.github.com/users/emilengler/following{/other_user}","gists_url":"https://api.github.com/users/emilengler/gists{/gist_id}","starred_url":"https://api.github.com/users/emilengler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilengler/subscriptions","organizations_url":"https://api.github.com/users/emilengler/orgs","repos_url":"https://api.github.com/users/emilengler/repos","events_url":"https://api.github.com/users/emilengler/events{/privacy}","received_events_url":"https://api.github.com/users/emilengler/received_events","type":"User","site_admin":false},"created_at":"2019-07-06T13:30:59Z","updated_at":"2019-07-06T13:30:59Z","author_association":"CONTRIBUTOR","body":"@fqlx @promag @achow101 \r\nTest added, can someone take a look at it?"}}
{"actor":{"display_login":"emilengler"}}