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

Method SetCoinbase

core/chain_makers.go:53–62  ·  view source on GitHub ↗

SetCoinbase sets the coinbase of the generated block. It can be called at most once.

(addr common.Address)

Source from the content-addressed store, hash-verified

51// SetCoinbase sets the coinbase of the generated block.
52// It can be called at most once.
53func (b *BlockGen) SetCoinbase(addr common.Address) {
54 if b.gasPool != nil {
55 if len(b.txs) > 0 {
56 panic("coinbase must be set before adding transactions")
57 }
58 panic("coinbase can only be set once")
59 }
60 b.header.Coinbase = addr
61 b.gasPool = new(GasPool).AddGas(b.header.GasLimit)
62}
63
64// SetExtra sets the extra data field of the generated block.
65func (b *BlockGen) SetExtra(data []byte) {

Callers 7

AddTxWithChainMethod · 0.95
makeBlockChainFunction · 0.45
ExampleGenerateChainFunction · 0.45
TestTrieForkGCFunction · 0.45
TestLargeReorgTrieGCFunction · 0.45

Calls 1

AddGasMethod · 0.80

Tested by 5

ExampleGenerateChainFunction · 0.36
TestTrieForkGCFunction · 0.36
TestLargeReorgTrieGCFunction · 0.36