def apply_tx(self, txhash, raw_tx):
        """Given a transaction <composed_tx_spec>, delete any
        utxos that it spends and add any utxos that are new
        """

        all_addresses = [a.get_address() for a in
                         self.model.get_address_manager().get_all_addresses()]

        ctxs = raw_tx.composed_tx_spec

        # record spends
        for txin in ctxs.txins:
            prev_txhash, prev_outindex = txin.get_outpoint()
            coin_id = self.store.find_coin(prev_txhash, prev_outindex)
            if coin_id:
                self.store.add_spend(coin_id, txhash)
                
        # put the new utxo into the db
        for i, txout in enumerate(ctxs.txouts):
            script = raw_tx.pycoin_tx.txs_out[i].script.encode('hex')
            if all_addresses in txout.target_addr:
                self.add_coin(txout.target_addr, txhash, i,
                              txout.value, script)
dataset/ETHPy150Open chromaway/ngcccbase/ngcccbase/coindb.py/CoinManager.apply_tx/swapped operands of `in`