5 // BlockHeader contains the header information for a blockchain
6 // block. It satisfies the Entry interface.
8 func (BlockHeader) typ() string { return "blockheader" }
9 func (bh *BlockHeader) writeForHash(w io.Writer) {
10 mustWriteForHash(w, bh.Version)
11 mustWriteForHash(w, bh.Height)
12 mustWriteForHash(w, bh.PreviousBlockId)
13 mustWriteForHash(w, bh.Timestamp)
14 //mustWriteForHash(w, bh.Coinbase)
15 mustWriteForHash(w, bh.TransactionsRoot)
16 mustWriteForHash(w, bh.TransactionStatusHash)
17 mustWriteForHash(w, bh.Proof.Sign)
18 mustWriteForHash(w, bh.Proof.ControlProgram)
19 mustWriteForHash(w, bh.Extra)
22 // NewBlockHeader creates a new BlockHeader and populates
24 func NewBlockHeader(version, height uint64, previousBlockID *Hash, timestamp uint64, transactionsRoot, transactionStatusHash *Hash, proof *Proof, extra []byte, coinbase []byte) *BlockHeader {
28 PreviousBlockId: previousBlockID,
30 TransactionsRoot: transactionsRoot,
31 TransactionStatusHash: transactionStatusHash,
32 TransactionStatus: nil,