def initialize_from_block(self, block, nonce=0, prefill_list=None, use_witness=False):
    if (prefill_list is None):
        prefill_list = [0]
    self.header = CBlockHeader(block)
    self.nonce = nonce
    self.prefilled_txn = [PrefilledTransaction(i, block.vtx[i]) for i in prefill_list]
    self.shortids = []
    self.use_witness = use_witness
    [k0, k1] = self.get_siphash_keys()
    for i in range(len(block.vtx)):
        if (i not in prefill_list):
            tx_hash = block.vtx[i].sha256
            if use_witness:
                tx_hash = block.vtx[i].calc_sha256(with_witness=True)
            self.shortids.append(calculate_shortid(k0, k1, tx_hash))
def initialize_from_block(self, block, nonce=0, prefill_list=None, use_witness=False):
    if (prefill_list is None):
        prefill_list = [0]
    self.header = CBlockHeader(block)
    self.nonce = nonce
    self.prefilled_txn = [PrefilledTransaction(i, block.vtx[i]) for i in prefill_list]
    self.shortids = []
    self.use_witness = use_witness
    [k0, k1] = self.get_siphash_keys()
    for i in range(len(block.vtx)):
        if (i not in prefill_list):
            tx_hash = block.vtx[i].sha256
            if use_witness:
                tx_hash = block.vtx[i].calc_sha256(with_witness=True)
            self.shortids.append(calculate_shortid(k0, k1, tx_hash))