 
     dialog = $ view {
       outs: for { script: out_script, value } in tx.outs
-        address: get_address out_script.simpleOutHash(), ADDR_PUB
+        address: get_script_address out_script
         value: BitUtil.formatValue value.slice().reverse()
       has_priv: priv?
       pub_address: get_address pub, ADDR_PUB

{ Bitcoin, Crypto, BigInteger } = require '../../lib/bitcoinjs-lib.js'
{ iferr, error_displayer } = require '../util.coffee'
{ get_address, parse_address, parse_key_bytes, get_pub, ADDR_PUB, ADDR_PRIV } = require '../bitcoin.coffee'
{ sign_tx, calc_total_in, sum_inputs, decode_raw_tx } = require './lib.coffee'
{ tx_listen, load_unspent } = require './networking.coffee'
{ bytesToHex } = Crypto.util
{ Transaction, Util: BitUtil } = Bitcoin

# Initialize the transaction builder interface,
# and return a teardown function

  # Read outputs from DOM
  $form.find('.address').each ->
    $this = $ this
    tx.addOutput new TransactionOut
      script: create_out_script $this.find('[name=address]').val()
      value: BitUtil.parseValue($this.find('[name=value]').val()).toByteArrayUnsigned().reverse()
  tx

# Display the transaction dialog
