   #-----------------------------------
 
   cfg : (k) -> @args[k] or @config[k]
+
+  #-----------------------------------
+
+  icfg : (k, def = null) ->
+    v = @config[k] unless (v = @args[k])?
+    if not v? then def
+    else if isNaN(v = parseInt(v, 10)) then null
+    else v
 
   #-----------------------------------
 


  is_good_input_tx : (tx) ->
    amt = tx.amount * SATOSHI_PER_BTC
    (tx.address is @from_address()) and 
      (amt >= @min_amount()) and (amt <= @max_amount()) and
      (tx.confirmations >= @min_confirmations())

  #-----------------------------------

  find_transaction : (cb) ->
    esc = make_esc cb, "Runner::find_transaction"
    await @cli.listUnspent esc defer txs
    for tx in txs
      if @is_good_input_tx tx
        @input_tx = tx
        break
    if not @input_tx?
      err = new Error "Couldn't find spendable input transaction"
    cb err

  #-----------------------------------

    esc = make_esc cb, "Runner::main"
    await @parse_args argv, esc defer()
    await @read_config esc defer()
    await @check_args esc defer()
    await @make_bitcoin_client esc defer()
    await @find_transaction esc defer()
    console.log @input_tx
    #await @find_post_data esc defer()
    #await @get_private_key esc defer()
    #await @make_transaction esc defer()
