def try_prepare_raw_transaction(self, message):
    inputs = []

    logging.debug(message)

    for tx in message['prevtxs']:
      inputs.append({'txid': tx['txid'], 'vout': tx['vout']})

    if len(self.input_addresses(message['prevtxs']))>1:
      logging.debug("all inputs should come from the same multisig address")
      return False

    cash_back = Decimal(Decimal(SATOSHI) * (message['sum_satoshi'] - message['miners_fee_satoshi']))

    logging.debug(cash_back)

    outputs = {}#message['outputs']

    has_my_fee = False
    for oracle, fee in message['outputs'].iteritems(): #outputs.iteritems():
      outputs[oracle] = fee
      cash_back -= Decimal(fee)

      if self.oracle.is_fee_sufficient(oracle, fee):
        has_my_fee = True

    if not has_my_fee:
      logging.debug("no fee for this oracle, skipping")
      return None

    if cash_back < 0:
      logging.debug("BTC amount not high enough to cover expenses")
      return None

    outputs[ message['return_address'] ] = float(cash_back)

    logging.debug("outputs2: %r" % outputs)

    for address in outputs:
      # My heart bleeds when I write it
      # but btc expects float as input for the currency amount
      outputs[address] = float(outputs[address])


    logging.debug(outputs)

    transaction = self.btc.create_raw_transaction(inputs, outputs)
    return transaction
dataset/ETHPy150Open orisi/orisi/src/oracle/handlers/basehandler.py/BaseHandler.try_prepare_raw_transaction/original