anchor.diff:      true = channel_block_tx:is_cb(NewCh),
       F = read(ChId),
       Ch = sign:data(F#f.channel),
  -    io:fwrite("\nABC"),
  -    io:fwrite("old ch "),
  -    io:fwrite(packer:pack(Ch)),
  -    io:fwrite("\n"),
  -    io:fwrite("new ch from partner"),
  -    io:fwrite(packer:pack(NewCh)),
       NewAmount = channel_block_tx:amount(NewCh),
       OldAmount = channel_block_tx:amount(Ch),
       NewN = channel_block_tx:nonce(NewCh),
  
positive.code:             Acc2 -> 0
          end,
      Script = language:hashlock(MyAccount, SecretHash),
  
      io:fwrite("\n"),
      io:fwrite("old ch "),
      io:fwrite(packer:pack(Ch)),
      io:fwrite("\n"),
      io:fwrite("new ch"),
      io:fwrite(packer:pack(Ch2)),
      io:fwrite("\n"),
      io:fwrite("a "),
      io:fwrite(integer_to_list(Amount div 2)),
      io:fwrite("\n"),
      io:fwrite("script "),
      io:fwrite(packer:pack(Script)),
      io:fwrite("\n"),
  
  
      keys:sign(channel_block_tx:add_bet(Ch2, Amount div 2, Script)).
  %NewF = #f{channel = Ch3, unlock = [[1]|F#f.unlock]},
  %store(ChId, NewF).
  
negative.code:     end,
      SecretHash = language:extract_sh(channel_block_tx:bet_code(hd(channel_block_tx:bets(NewCh)))),
      Script = language:hashlock(ToAmount, SecretHash),
      NewCha = channel_block_tx:add_bet(Ch2, A, Script),%this ensures that they didn't adjust anything else in the channel besides the amount and nonce and bet.
      NewCh = NewCha,
      NewF = #f{channel = SignedChannel, unlock = F#f.unlock},
      store(ChId, NewF),
      keys:sign(NewCh).
  
  recieve(ChId, MinAmount, SignedPayment) ->
      %we need to verify that the other party signed it.
      ID = keys:id(),
      Payment = sign:data(SignedPayment),
  