def spend_utxo(self, node_id, utxo, recipient=''):
    ' spend amount from previously unspent output to a provided address\n        :param    node_id:    (int) index of the CTestNode used as rpc connection. Must own the utxo.\n                  utxo:       (JSON) returned from listunspent used as input\n                  recipient:  (string) destination address (new one if not provided)\n        :return:  txhash:     (string) tx hash if successful, empty string otherwise\n        '
    assert_greater_than(len(self.nodes), node_id)
    rpc_conn = self.nodes[node_id]
    inputs = [{'txid': utxo['txid'], 'vout': utxo['vout']}]
    out_amount = (float(utxo['amount']) - DEFAULT_FEE)
    outputs = {}
    if (recipient == ''):
        recipient = rpc_conn.getnewaddress()
    outputs[recipient] = out_amount
    return self.spend_inputs(node_id, inputs, outputs)
spend amount from previously unspent output to a provided address
:param    node_id:    (int) index of the CTestNode used as rpc connection. Must own the utxo.
          utxo:       (JSON) returned from listunspent used as input
          recipient:  (string) destination address (new one if not provided)
:return:  txhash:     (string) tx hash if successful, empty string otherwise
def spend_utxo(self, node_id, utxo, recipient=):
    ' spend amount from previously unspent output to a provided address\n        :param    node_id:    (int) index of the CTestNode used as rpc connection. Must own the utxo.\n                  utxo:       (JSON) returned from listunspent used as input\n                  recipient:  (string) destination address (new one if not provided)\n        :return:  txhash:     (string) tx hash if successful, empty string otherwise\n        '
    assert_greater_than(len(self.nodes), node_id)
    rpc_conn = self.nodes[node_id]
    inputs = [{'txid': utxo['txid'], 'vout': utxo['vout']}]
    out_amount = (float(utxo['amount']) - DEFAULT_FEE)
    outputs = {}
    if (recipient == ):
        recipient = rpc_conn.getnewaddress()
    outputs[recipient] = out_amount
    return self.spend_inputs(node_id, inputs, outputs)