()
| 546 | } |
| 547 | |
| 548 | func GetBlockCount() (uint32, error) { |
| 549 | data, ontErr := sendRpcRequest("getblockcount", []interface{}{}) |
| 550 | if ontErr != nil { |
| 551 | return 0, ontErr.Error |
| 552 | } |
| 553 | num := uint32(0) |
| 554 | err := json.Unmarshal(data, &num) |
| 555 | if err != nil { |
| 556 | return 0, fmt.Errorf("json.Unmarshal:%s error:%s", data, err) |
| 557 | } |
| 558 | return num, nil |
| 559 | } |
| 560 | |
| 561 | func GetTxHeight(txHash string) (uint32, error) { |
| 562 | data, ontErr := sendRpcRequest("getblockheightbytxhash", []interface{}{txHash}) |
no test coverage detected