(b *types.Block)
| 352 | } |
| 353 | |
| 354 | func (c *Chain) genesis(b *types.Block) (err error) { |
| 355 | if b == nil { |
| 356 | err = errors.New("genesis block not provided") |
| 357 | return |
| 358 | } |
| 359 | if err = b.VerifyAsGenesis(); err != nil { |
| 360 | err = errors.Wrap(err, "initialize chain state") |
| 361 | return |
| 362 | } |
| 363 | return c.pushBlock(b) |
| 364 | } |
| 365 | |
| 366 | // pushBlock pushes the signed block header to extend the current main chain. |
| 367 | func (c *Chain) pushBlock(b *types.Block) (err error) { |
no test coverage detected