OSDN Git Service

init version of edit block header (#389)
[bytom/bytom.git] / protocol / bc / blockheader.go
index 5e98630..34c5ccf 100644 (file)
@@ -10,28 +10,25 @@ func (bh *BlockHeader) writeForHash(w io.Writer) {
        mustWriteForHash(w, bh.Version)
        mustWriteForHash(w, bh.Height)
        mustWriteForHash(w, bh.PreviousBlockId)
-       mustWriteForHash(w, bh.Seed)
-       mustWriteForHash(w, bh.TimestampMs)
+       mustWriteForHash(w, bh.Timestamp)
        mustWriteForHash(w, bh.TransactionsRoot)
-       mustWriteForHash(w, bh.AssetsRoot)
-       mustWriteForHash(w, bh.Nonce)
+       mustWriteForHash(w, bh.TransactionStatusHash)
        mustWriteForHash(w, bh.Bits)
-       mustWriteForHash(w, bh.TransactionStatus)
+       mustWriteForHash(w, bh.Nonce)
 }
 
 // NewBlockHeader creates a new BlockHeader and populates
 // its body.
-func NewBlockHeader(version, height uint64, previousBlockID, seed *Hash, timestampMS uint64, transactionsRoot, assetsRoot *Hash, ts *TransactionStatus, nonce, bits uint64) *BlockHeader {
+func NewBlockHeader(version, height uint64, previousBlockID *Hash, timestamp uint64, transactionsRoot, transactionStatusHash *Hash, nonce, bits uint64) *BlockHeader {
        return &BlockHeader{
-               Version:           version,
-               Height:            height,
-               PreviousBlockId:   previousBlockID,
-               Seed:              seed,
-               TimestampMs:       timestampMS,
-               TransactionsRoot:  transactionsRoot,
-               AssetsRoot:        assetsRoot,
-               TransactionStatus: ts,
-               Nonce:             nonce,
-               Bits:              bits,
+               Version:               version,
+               Height:                height,
+               PreviousBlockId:       previousBlockID,
+               Timestamp:             timestamp,
+               TransactionsRoot:      transactionsRoot,
+               TransactionStatusHash: transactionStatusHash,
+               TransactionStatus:     nil,
+               Bits:                  bits,
+               Nonce:                 nonce,
        }
 }