@@ -824,6 +824,13 @@ void do_test_message_handler_b(TestState state) throws InterruptedException {
824824 Thread .sleep (100 );
825825 }
826826
827+ if (state .peer1 .chain_monitor != null ) {
828+ Balance [] peer1_balances = state .peer1 .chain_monitor .get_claimable_balances (state .peer1 .chan_manager .list_channels ());
829+ assert peer1_balances .length == 0 ;
830+ Balance [] peer2_balances = state .peer2 .chain_monitor .get_claimable_balances (state .peer2 .chan_manager .list_channels ());
831+ assert peer2_balances .length == 0 ;
832+ }
833+
827834 ChannelDetails [] peer1_chans = state .peer1 .chan_manager .list_channels ();
828835
829836 if (nice_close ) {
@@ -851,7 +858,25 @@ void do_test_message_handler_b(TestState state) throws InterruptedException {
851858
852859 assert state .peer1 .broadcast_set .size () == 1 ;
853860 assert state .peer2 .broadcast_set .size () == 1 ;
861+ }
862+
863+ if (state .peer1 .chain_monitor != null ) {
864+ Balance [] peer1_balances = state .peer1 .chain_monitor .get_claimable_balances (state .peer1 .chan_manager .list_channels ());
865+ assert peer1_balances .length == 1 ;
866+ for (Balance bal : peer1_balances ) {
867+ assert bal instanceof Balance .ClaimableOnChannelClose ;
868+ long expected_tx_fee = 183 ;
869+ assert ((Balance .ClaimableOnChannelClose ) bal ).claimable_amount_satoshis == 100000 - 1 - 10000 - expected_tx_fee ;
870+ }
871+ Balance [] peer2_balances = state .peer2 .chain_monitor .get_claimable_balances (state .peer2 .chan_manager .list_channels ());
872+ assert peer2_balances .length == 1 ;
873+ for (Balance bal : peer2_balances ) {
874+ assert bal instanceof Balance .ClaimableOnChannelClose ;
875+ assert ((Balance .ClaimableOnChannelClose ) bal ).claimable_amount_satoshis == 10000 + 1 ;
876+ }
877+ }
854878
879+ if (!nice_close ) {
855880 NetworkParameters bitcoinj_net = NetworkParameters .fromID (NetworkParameters .ID_MAINNET );
856881 Transaction tx = new Transaction (bitcoinj_net , state .peer1 .broadcast_set .getFirst ());
857882 Block b = new Block (bitcoinj_net , 2 , state .best_blockhash , Sha256Hash .ZERO_HASH , 42 , 0 , 0 ,
0 commit comments