MCPcopy Create free account
hub / github.com/chain/txvm / GetBlock

Method GetBlock

protocol/block.go:29–31  ·  view source on GitHub ↗

GetBlock returns the block at the given height, if there is one, otherwise it returns an error.

(ctx context.Context, height uint64)

Source from the content-addressed store, hash-verified

27// GetBlock returns the block at the given height, if there is one,
28// otherwise it returns an error.
29func (c *Chain) GetBlock(ctx context.Context, height uint64) (*bc.Block, error) {
30 return c.store.GetBlock(ctx, height)
31}
32
33// GenerateBlock generates a valid, but unsigned, candidate block from
34// the current pending transaction pool. It returns the new block and

Callers 1

TestGetBlockFunction · 0.95

Calls 1

GetBlockMethod · 0.65

Tested by 1

TestGetBlockFunction · 0.76