message: test: Add `nFlags` in `CBlockHeader` class
diff: @@ -631,7 +631,7 @@ class CTransaction:
  class CBlockHeader:
  - __slots__ = ("hash", "hashMerkleRoot", "hashPrevBlock", "nBits", "nNonce",
  + __slots__ = ("hash", "hashMerkleRoot", "hashPrevBlock", "nBits", "nNonce", "nFlags",
  "nTime", "nVersion", "sha256")
  def __init__(self, header=None):
  @@ -644,9 +644,9 @@ class CBlockHeader:
  self.nTime = header.nTime
  self.nBits = header.nBits
  self.nNonce = header.nNonce
  + self.nFlags = header.nFlags
  self.sha256 = header.sha256
  self.hash = header.hash
  - self.nFlags = header.nFlags
  self.calc_sha256()
  def set_null(self):
  @@ -667,6 +667,7 @@ class CBlockHeader:
  self.nTime = struct.unpack("<I", f.read(4))[0]
  self.nBits = struct.unpack("<I", f.read(4))[0]
  self.nNonce = struct.unpack("<I", f.read(4))[0]
  + self.nFlags = struct.unpack("<I", f.read(4))[0]
  self.sha256 = None
  self.hash = None
  @@ -678,6 +679,7 @@ class CBlockHeader:
  r += struct.pack("<I", self.nTime)
  r += struct.pack("<I", self.nBits)
  r += struct.pack("<I", self.nNonce)
  + r += struct.pack("<I", self.nFlags)
  return r
  def calc_sha256(self):
  @@ -698,12 +700,12 @@ class CBlockHeader:
  return self.sha256
  def __repr__(self):
  - return "CBlockHeader(nVersion=%i hashPrevBlock=%064x hashMerkleRoot=%064x nTime=%s nBits=%08x nNonce=%08x)" \
  + return "CBlockHeader(nVersion=%i hashPrevBlock=%064x hashMerkleRoot=%064x nTime=%s nBits=%08x nNonce=%08x nFlags=%08x)" \
  % (self.nVersion, self.hashPrevBlock, self.hashMerkleRoot,
  - time.ctime(self.nTime), self.nBits, self.nNonce)
  + time.ctime(self.nTime), self.nBits, self.nNonce, self.nFlags)
  BLOCK_HEADER_SIZE = len(CBlockHeader().serialize())
  -assert_equal(BLOCK_HEADER_SIZE, 80)
  +assert_equal(BLOCK_HEADER_SIZE, 84)
  class CBlock(CBlockHeader):
  __slots__ = ("vtx", "vchBlockSig",)
  