BlockMeta uses BlockID

This commit is contained in:
Ethan Buchman
2017-02-14 15:33:14 -05:00
parent e229c8c3d7
commit 99b068b313
8 changed files with 26 additions and 26 deletions

View File

@ -1,15 +1,13 @@
package types
type BlockMeta struct {
Hash []byte `json:"hash"` // The block hash
Header *Header `json:"header"` // The block's Header
PartsHeader PartSetHeader `json:"parts_header"` // The PartSetHeader, for transfer
BlockID BlockID `json:"block_id"` // the block hash and partsethash
Header *Header `json:"header"` // The block's Header
}
func NewBlockMeta(block *Block, blockParts *PartSet) *BlockMeta {
return &BlockMeta{
Hash: block.Hash(),
Header: block.Header,
PartsHeader: blockParts.Header(),
BlockID: BlockID{block.Hash(), blockParts.Header()},
Header: block.Header,
}
}