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

Function makeBlockChain

core/chain_makers.go:262–267  ·  view source on GitHub ↗

makeBlockChain creates a deterministic chain of blocks rooted at parent.

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

Source from the content-addressed store, hash-verified

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 {
263 blocks, _ := GenerateChain(configs.TestChainConfig, parent, engine, db, nil, n, func(i int, b *BlockGen) {
264 b.SetCoinbase(common.Address{0: byte(seed), 19: byte(i)})
265 })
266 return blocks
267}

Callers 6

makeHeaderChainFunction · 0.85
newCanonicalFunction · 0.85
testForkFunction · 0.85
TestLastBlockFunction · 0.85
TestBrokenBlockChainFunction · 0.85

Calls 2

GenerateChainFunction · 0.85
SetCoinbaseMethod · 0.45

Tested by 5

newCanonicalFunction · 0.68
testForkFunction · 0.68
TestLastBlockFunction · 0.68
TestBrokenBlockChainFunction · 0.68