MCPcopy Create free account
hub / github.com/DNAProject/DNA / GetBlockCount

Function GetBlockCount

cmd/utils/gas.go:548–559  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

546}
547
548func 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
561func GetTxHeight(txHash string) (uint32, error) {
562 data, ontErr := sendRpcRequest("getblockheightbytxhash", []interface{}{txHash})

Callers 2

exportBlocksFunction · 0.92
curBlockHeightFunction · 0.92

Calls 2

sendRpcRequestFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected