5 // BlockHeader contains the header information for a blockchain
6 // block. It satisfies the Entry interface.
7 func (BlockHeader) typ() string { return "blockheader" }
8 func (bh *BlockHeader) writeForHash(w io.Writer) {
9 mustWriteForHash(w, bh.Version)
10 mustWriteForHash(w, bh.Height)
11 mustWriteForHash(w, bh.PreviousBlockId)
12 mustWriteForHash(w, bh.Timestamp)
13 mustWriteForHash(w, bh.TransactionsRoot)
16 // NewBlockHeader creates a new BlockHeader and populates
18 func NewBlockHeader(version, height uint64, previousBlockID *Hash, timestamp uint64, transactionsRoot *Hash) *BlockHeader {
22 PreviousBlockId: previousBlockID,
24 TransactionsRoot: transactionsRoot,