 
   _createAgreementTxT1: (serverPubkeyK2) ->
     console.info "building 2of 2"
-    multiSigTxBuilder = CoinUtils.build2of2MultiSigTx @pubkeyK1, serverPubkeyK2, @maxPayment
+    multiSigTxBuilder = CoinUtils.build2of2MultiSigTx @pubkeyHashK1, serverPubkeyK2, @maxPaymentSatoshi
     console.info "built 2of 2"
     # TODO: What about all the input transactions? What are they signed with?
     multiSigTx = multiSigTxBuilder.sign([@privkeyK1])



  _createRefundTxT2: (timeToLock) ->
    return CoinUtils.buildRollingRefundTxFromMultiSigOutput @agreementTxT1, @agreementTxT1Unbuilt.valueOutSat, @pubkeyK1, 0, undefined, timeToLock

  _verifyServerSignedT2: (signature) ->
    return CoinUtils.verifyTxSig @refundTxT2, signature

  _createPayTxT3: (amount, serverPubKey) ->
    return CoinUtils.buildRollingRefundTxFromMultiSigOutput @agreementTxT1, @agreementTxT1Unbuilt.valueOutSat, @pubkeyK1, amount, serverPubKey, 0



  channelId: undefined
  timeLock: undefined
  pubkeyHashK1: undefined
  privkeyK1: undefined
  serverPubkeyK2: undefined
  maxPaymentSatoshi: undefined
  agreementTxT1: undefined
  agreementTxT1Unbuilt: undefined
  agreementTxT1ScriptPubkey: undefined
  refundTxT2: undefined
  paymentTotalTx3: 0

  constructor: (@pubkeyHashK1, @privkeyK1, @maxPaymentSatoshi) ->

  createAndCommit: (callback) ->

