+ }
+
+ events = state.peer2.get_manager_events(1, state.peer1, state.peer2);
+ assert events[0] instanceof Event.ChannelClosed;
+ events = state.peer1.get_manager_events(1, state.peer1, state.peer2);
+ assert events[0] instanceof Event.ChannelClosed;
+
+ if (state.peer1.chain_monitor != null) {
+ Balance[] peer1_balances = state.peer1.chain_monitor.get_claimable_balances(state.peer1.chan_manager.list_channels());
+ assert peer1_balances.length == 1;
+ for (Balance bal : peer1_balances) {
+ assert bal instanceof Balance.ClaimableOnChannelClose;
+ long expected_tx_fee = 183;
+ assert ((Balance.ClaimableOnChannelClose) bal).claimable_amount_satoshis == 100000 - 1 - 10000 - expected_tx_fee;
+ }
+ Balance[] peer2_balances = state.peer2.chain_monitor.get_claimable_balances(state.peer2.chan_manager.list_channels());
+ assert peer2_balances.length == 1;
+ for (Balance bal : peer2_balances) {
+ assert bal instanceof Balance.ClaimableOnChannelClose;
+ assert ((Balance.ClaimableOnChannelClose) bal).claimable_amount_satoshis == 10000 + 1;
+ }
+ }