5 func (BytomBlockHeader) typ() string { return "blockheader" }
6 func (bh *BytomBlockHeader) writeForHash(w io.Writer) {
7 mustWriteForHash(w, bh.Version)
8 mustWriteForHash(w, bh.Height)
9 mustWriteForHash(w, bh.PreviousBlockId)
10 mustWriteForHash(w, bh.Timestamp)
11 mustWriteForHash(w, bh.TransactionsRoot)
12 mustWriteForHash(w, bh.TransactionStatusHash)
13 mustWriteForHash(w, bh.Bits)
14 mustWriteForHash(w, bh.Nonce)
17 // NewBytomBlockHeader creates a new BlockHeader and populates
19 func NewBytomBlockHeader(version, height uint64, previousBlockID *Hash, timestamp uint64, transactionsRoot, transactionStatusHash *Hash, nonce, bits uint64) *BytomBlockHeader {
20 return &BytomBlockHeader{
23 PreviousBlockId: previousBlockID,
25 TransactionsRoot: transactionsRoot,
26 TransactionStatusHash: transactionStatusHash,
27 TransactionStatus: nil,