   #-----------------------------------
 
   submit_transaction : (cb) ->
-    #await @client.sendRawTransaction @out_tx.toHex(), defer err, @out_tx_id
-    console.log @out_tx.toHex()
+    err = null
+    await @client.sendRawTransaction @out_tx.toHex(), defer err, @out_tx_id
+    console.error "Raw transaction: " + @out_tx.toHex()
     cb err
 
   #-----------------------------------


  make_transaction : (cb) ->
    err = null
    @data_to_address = (new btcjs.Address @to_address(), 0).toBase58Check()
    tx = new btcjs.Transaction
    tx.addInput @input_tx.txid, @input_tx.vout
    num = @num_outputs()
    for i in [0...num]
      tx.addOutput @data_to_address, @min_amount()
    skey = btcjs.ECKey.fromWIF @priv_key

    # Sign temporarily with a fictitious amount of change

    await @init argv, esc defer()
    await @find_transaction esc defer()
    await @get_private_key esc defer()
    await @make_change_address esc defer()
    await @make_transaction esc defer()
    await @submit_transaction esc defer()
    await @write_output esc defer()
