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

Function makeHeaderChain

core/chain_makers.go:252–259  ·  view source on GitHub ↗

makeHeaderChain creates a deterministic chain of headers rooted at parent.

(parent *types.Header, n int, engine consensus.Engine, db database.Database, seed int)

Source from the content-addressed store, hash-verified

250
251// makeHeaderChain creates a deterministic chain of headers rooted at parent.
252func makeHeaderChain(parent *types.Header, n int, engine consensus.Engine, db database.Database, seed int) []*types.Header {
253 blocks := makeBlockChain(types.NewBlockWithHeader(parent), n, engine, db, seed)
254 headers := make([]*types.Header, len(blocks))
255 for i, block := range blocks {
256 headers[i] = block.Header()
257 }
258 return headers
259}
260
261// makeBlockChain creates a deterministic chain of blocks rooted at parent.
262func makeBlockChain(parent *types.Block, n int, engine consensus.Engine, db database.Database, seed int) []*types.Block {

Callers

nothing calls this directly

Calls 2

makeBlockChainFunction · 0.85
HeaderMethod · 0.80

Tested by

no test coverage detected