MCPcopy Create free account
hub / github.com/CPChain/chain / BlockNumber

Method BlockNumber

internal/cpcapi/api.go:585–588  ·  view source on GitHub ↗

BlockNumber returns the block number of the chain head.

()

Source from the content-addressed store, hash-verified

583
584// BlockNumber returns the block number of the chain head.
585func (s *PublicBlockChainAPI) BlockNumber() hexutil.Uint64 {
586 header, _ := s.b.HeaderByNumber(context.Background(), rpc.LatestBlockNumber) // latest header should always be available
587 return hexutil.Uint64(header.Number.Uint64())
588}
589
590// GetBalance returns the amount of wei for the given address in the state of the
591// given block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta

Callers 12

GetBlockRlpMethod · 0.80
PrintBlockMethod · 0.80
getBlockPricesMethod · 0.80
indexedLogsMethod · 0.80
unindexedLogsMethod · 0.80
SubscribeLogsMethod · 0.80
BalanceAtMethod · 0.80
NonceAtMethod · 0.80
BlockByNumberMethod · 0.80
HeaderByNumberMethod · 0.80
getBalanceAtFunction · 0.80

Calls 2

Uint64Method · 0.80
HeaderByNumberMethod · 0.65

Tested by

no test coverage detected