def create_block(hashprev, coinbase, nTime=None):
    block = CBlock()
    if (nTime is None):
        import time
        block.nTime = int((time.time() + 600))
    else:
        block.nTime = nTime
    block.hashPrevBlock = hashprev
    block.nBits = 504365040
    block.vtx.append(coinbase)
    block.hashMerkleRoot = block.calc_merkle_root()
    block.calc_sha256()
    return block
def create_block(hashprev, coinbase, nTime=None):
    block = CBlock()
    if (nTime is None):
        import time
        block.nTime = int((time.time() + 600))
    else:
        block.nTime = nTime
    block.hashPrevBlock = hashprev
    block.nBits = 504365040
    block.vtx.append(coinbase)
    block.hashMerkleRoot = block.calc_merkle_root()
    block.calc_sha256()
    return block