get_block_header_by_height - 获取指定高度的区块头
get_block_header_by_height
用来获取指定高度的区块头信息,其别名
为getblockheaderbyheight
。
输入参数
- height:区块高度,unsigned int
输出结果
- block_header:区块头结构,参见get_last_block_header
- status:RPC错误代码,string,"OK"表示一切正常
- untrusted:是否可信, boolean
示例代码
curl请求:
$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json'
响应代码:
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"block_header": {
"block_size": 210,
"depth": 649721,
"difficulty": 815625611,
"hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6",
"height": 912345,
"major_version": 1,
"minor_version": 2,
"nonce": 1646,
"num_txes": 0,
"orphan_status": false,
"prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78",
"reward": 7388968946286,
"timestamp": 1452793716
},
"status": "OK",
"untrusted": false
}
}