def is_valid(self):
    self.calc_sha256()
    target = uint256_from_compact(self.nufos)
    if (self.sha256 > target):
        return False
    for tx in self.vtx:
        if (not tx.is_valid()):
            return False
    if (self.calc_merkle_root() != self.hashMerkleRoot):
        return False
    return True
def is_valid(self):
    self.calc_sha256()
    target = uint256_from_compact(self.nufos)
    if (self.sha256 > target):
        return False
    for tx in self.vtx:
        if (not tx.is_valid()):
            return False
    if (self.calc_merkle_root() != self.hashMerkleRoot):
        return False
    return True