SetCoinbase sets the coinbase of the generated block. It can be called at most once.
(addr common.Address)
| 51 | // SetCoinbase sets the coinbase of the generated block. |
| 52 | // It can be called at most once. |
| 53 | func (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. |
| 65 | func (b *BlockGen) SetExtra(data []byte) { |