MCPcopy Create free account
hub / github.com/DOSNetwork/core / GetCurrentBlock

Function GetCurrentBlock

onchain/eth_helpers.go:261–268  ·  view source on GitHub ↗

GetCurrentBlock returns a block number of latest known header from the current canonical chain.

(client *ethclient.Client)

Source from the content-addressed store, hash-verified

259// GetCurrentBlock returns a block number of latest known header from the
260// current canonical chain.
261func GetCurrentBlock(client *ethclient.Client) (blknum uint64, err error) {
262 var header *types.Header
263 header, err = client.HeaderByNumber(context.Background(), nil)
264 if err == nil {
265 blknum = header.Number.Uint64()
266 }
267 return
268}
269
270// CheckTransaction return an error if the transaction is failed
271func CheckTransaction(client *ethclient.Client, tx *types.Transaction) (err error) {

Callers

nothing calls this directly

Calls 1

Uint64Method · 0.80

Tested by

no test coverage detected