core, core/types, eth: add and use Block.Body

This fixes a few uses of unkeyed Body literals which go vet was
complaining about.
This commit is contained in:
Felix Lange
2016-04-15 10:57:37 +02:00
parent fdc5a7dc1a
commit 24cdac41f3
5 changed files with 10 additions and 7 deletions

View File

@ -318,7 +318,7 @@ func WriteTd(db ethdb.Database, hash common.Hash, td *big.Int) error {
// WriteBlock serializes a block into the database, header and body separately.
func WriteBlock(db ethdb.Database, block *types.Block) error {
// Store the body first to retain database consistency
if err := WriteBody(db, block.Hash(), &types.Body{block.Transactions(), block.Uncles()}); err != nil {
if err := WriteBody(db, block.Hash(), block.Body()); err != nil {
return err
}
// Store the header too, signaling full block ownership