Height uint64 // The height of the block.
PreviousBlockHash bc.Hash // The hash of the previous block.
Timestamp uint64 // The time of the block in seconds.
- Nonce uint64 // Nonce used to generate the block.
- Bits uint64 // Difficulty target for the block.
BlockCommitment
}
if _, err = blockchain.ReadExtensibleString(r, bh.BlockCommitment.readFrom); err != nil {
return 0, err
}
- if bh.Nonce, err = blockchain.ReadVarint63(r); err != nil {
- return 0, err
- }
- if bh.Bits, err = blockchain.ReadVarint63(r); err != nil {
- return 0, err
- }
return
}
if _, err = blockchain.WriteExtensibleString(w, nil, bh.BlockCommitment.writeTo); err != nil {
return err
}
- if _, err = blockchain.WriteVarint63(w, bh.Nonce); err != nil {
- return err
- }
- if _, err = blockchain.WriteVarint63(w, bh.Bits); err != nil {
- return err
- }
return nil
}