anchor.diff:  -record(timeout, {acc = 0, nonce = 0, fee = 0, channel_block = 0}).
   -record(channel_slash, {acc = 0, nonce = 0, channel_block = 0}).
   -record(acc, {balance = 0, nonce = 0, pub = ""}).
  -
  -
  -sign_all([]) -> [];
  -sign_all([Tx|Txs]) -> [keys:sign(Tx)|sign_all(Txs)].
   buy_block() -> buy_block(tx_pool:txs()).
   buy_block(Txs) -> buy_block(Txs, 1).
   buy_block(Txs, BlockGap) ->
  
positive.code:     true = ToAcc#acc.balance > TheirBalance,
      Tx = #tc{acc1 = Id, acc2 = To, nonce = Acc#acc.nonce + 1, bal1 = MyBalance, bal2 = TheirBalance, consensus_flag = ConsensusFlag, fee = Fee},
      keys:sign(Tx).
  test() -> 
      {Pub, Priv} = sign:new_key(),
      create_account(Pub, 10000),
      spend(1, 10),
      SignedParent = block_finality:top_block(),
      SP = read_int(0, read(top)),
      SignedParent = SP#x.block,
      SP = read(hash:doit(SignedParent#signed.data)),
      buy_block(),
      SB = read_int(1, read(top)),
      SignedBlock = SB#x.block,
      SB = read(hash:doit(SignedBlock#signed.data)),
      CreateTx1 = create_channel(1, 10000, 1000, true, 0),
      SignedCreateTx1 = sign:sign_tx(CreateTx1, Pub, Priv, dict:new()),
      tx_pool:absorb(SignedCreateTx1),
  
negative.code:     SignedCreateTx3 = sign:sign_tx(CreateTx3, Pub, Priv, dict:new()),
      tx_pool:absorb(SignedCreateTx3),
      buy_block(),
      ToChannel = to_channel(0, 0, 10, 0),
      SignedToChannel = sign:sign_tx(ToChannel, Pub, Priv, dict:new()),
      tx_pool:absorb(SignedToChannel),
      buy_block(),
      ChannelTx = close_channel(0, -200, 1),
      TimeoutTx = channel_block(1, -200, 1, 0),
      SlasherTx = channel_block(2, -200, 1, 10),
      SignedChannelTx = sign:sign_tx(ChannelTx, Pub, Priv, dict:new()),
      SignedTimeoutTx = sign:sign_tx(TimeoutTx, Pub, Priv, dict:new()),
      SignedSlasherTx = sign:sign_tx(SlasherTx, Pub, Priv, dict:new()),
      tx_pool:absorb(SignedChannelTx),
      timeout_channel(SignedTimeoutTx),
      timeout_channel(SignedSlasherTx),
      buy_block(),
      SlashBlock = channel_block(2, 0, 2, 5),
      SignedSlashBlock = sign:sign_tx(SlashBlock, Pub, Priv,dict:new()),
      slow_close(1),
      channel_slash(SignedSlashBlock),
      buy_block(),
      success.
  