@@ -108,9 +108,9 @@ fn chanmon_claim_value_coop_close() {
108
108
assert_eq ! ( vec![ Balance :: ClaimableOnChannelClose {
109
109
claimable_amount_satoshis: 1_000_000 - 1_000 - chan_feerate * channel:: COMMITMENT_TX_BASE_WEIGHT / 1000
110
110
} ] ,
111
- nodes[ 0 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
111
+ nodes[ 0 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
112
112
assert_eq ! ( vec![ Balance :: ClaimableOnChannelClose { claimable_amount_satoshis: 1_000 , } ] ,
113
- nodes[ 1 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
113
+ nodes[ 1 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
114
114
115
115
nodes[ 0 ] . node . close_channel ( & chan_id) . unwrap ( ) ;
116
116
let node_0_shutdown = get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendShutdown , nodes[ 1 ] . node. get_our_node_id( ) ) ;
@@ -144,20 +144,20 @@ fn chanmon_claim_value_coop_close() {
144
144
claimable_amount_satoshis: 1_000_000 - 1_000 - chan_feerate * channel:: COMMITMENT_TX_BASE_WEIGHT / 1000 ,
145
145
confirmation_height: nodes[ 0 ] . best_block_info( ) . 1 + ANTI_REORG_DELAY - 1 ,
146
146
} ] ,
147
- nodes[ 0 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
147
+ nodes[ 0 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
148
148
assert_eq ! ( vec![ Balance :: ClaimableAwaitingConfirmations {
149
149
claimable_amount_satoshis: 1000 ,
150
150
confirmation_height: nodes[ 1 ] . best_block_info( ) . 1 + ANTI_REORG_DELAY - 1 ,
151
151
} ] ,
152
- nodes[ 1 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
152
+ nodes[ 1 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
153
153
154
154
connect_blocks ( & nodes[ 0 ] , ANTI_REORG_DELAY - 1 ) ;
155
155
connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY - 1 ) ;
156
156
157
157
assert_eq ! ( Vec :: <Balance >:: new( ) ,
158
- nodes[ 0 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
158
+ nodes[ 0 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
159
159
assert_eq ! ( Vec :: <Balance >:: new( ) ,
160
- nodes[ 1 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
160
+ nodes[ 1 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
161
161
162
162
let mut node_a_spendable = nodes[ 0 ] . chain_monitor . chain_monitor . get_and_clear_pending_events ( ) ;
163
163
assert_eq ! ( node_a_spendable. len( ) , 1 ) ;
@@ -231,11 +231,11 @@ fn do_test_claim_value_force_close(prev_commitment_tx: bool) {
231
231
claimable_amount_satoshis: 4_000 ,
232
232
claimable_height: htlc_cltv_timeout,
233
233
} ] ) ,
234
- sorted_vec( nodes[ 0 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
234
+ sorted_vec( nodes[ 0 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
235
235
assert_eq ! ( vec![ Balance :: ClaimableOnChannelClose {
236
236
claimable_amount_satoshis: 1_000 ,
237
237
} ] ,
238
- nodes[ 1 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
238
+ nodes[ 1 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
239
239
240
240
nodes[ 1 ] . node . claim_funds ( payment_preimage) ;
241
241
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
@@ -285,11 +285,11 @@ fn do_test_claim_value_force_close(prev_commitment_tx: bool) {
285
285
} ) ;
286
286
}
287
287
assert_eq ! ( sorted_vec( a_expected_balances) ,
288
- sorted_vec( nodes[ 0 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
288
+ sorted_vec( nodes[ 0 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
289
289
assert_eq ! ( vec![ Balance :: ClaimableOnChannelClose {
290
290
claimable_amount_satoshis: 1_000 + 3_000 + 4_000 ,
291
291
} ] ,
292
- nodes[ 1 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
292
+ nodes[ 1 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
293
293
294
294
// Broadcast the closing transaction (which has both pending HTLCs in it) and get B's
295
295
// broadcasted HTLC claim transaction with preimage.
@@ -343,7 +343,7 @@ fn do_test_claim_value_force_close(prev_commitment_tx: bool) {
343
343
claimable_amount_satoshis: 4_000 ,
344
344
claimable_height: htlc_cltv_timeout,
345
345
} ] ) ,
346
- sorted_vec( nodes[ 0 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
346
+ sorted_vec( nodes[ 0 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
347
347
// The main non-HTLC balance is just awaiting confirmations, but the claimable height is the
348
348
// CSV delay, not ANTI_REORG_DELAY.
349
349
assert_eq ! ( sorted_vec( vec![ Balance :: ClaimableAwaitingConfirmations {
@@ -359,7 +359,7 @@ fn do_test_claim_value_force_close(prev_commitment_tx: bool) {
359
359
claimable_amount_satoshis: 4_000 ,
360
360
timeout_height: htlc_cltv_timeout,
361
361
} ] ) ,
362
- sorted_vec( nodes[ 1 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
362
+ sorted_vec( nodes[ 1 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
363
363
364
364
connect_blocks ( & nodes[ 0 ] , ANTI_REORG_DELAY - 1 ) ;
365
365
expect_payment_failed ! ( nodes[ 0 ] , dust_payment_hash, true ) ;
@@ -374,7 +374,7 @@ fn do_test_claim_value_force_close(prev_commitment_tx: bool) {
374
374
claimable_amount_satoshis: 4_000 ,
375
375
claimable_height: htlc_cltv_timeout,
376
376
} ] ) ,
377
- sorted_vec( nodes[ 0 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
377
+ sorted_vec( nodes[ 0 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
378
378
assert_eq ! ( sorted_vec( vec![ Balance :: ClaimableAwaitingConfirmations {
379
379
claimable_amount_satoshis: 1_000 ,
380
380
confirmation_height: node_b_commitment_claimable,
@@ -385,7 +385,7 @@ fn do_test_claim_value_force_close(prev_commitment_tx: bool) {
385
385
claimable_amount_satoshis: 4_000 ,
386
386
timeout_height: htlc_cltv_timeout,
387
387
} ] ) ,
388
- sorted_vec( nodes[ 1 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
388
+ sorted_vec( nodes[ 1 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
389
389
390
390
let mut node_a_spendable = nodes[ 0 ] . chain_monitor . chain_monitor . get_and_clear_pending_events ( ) ;
391
391
assert_eq ! ( node_a_spendable. len( ) , 1 ) ;
@@ -411,13 +411,13 @@ fn do_test_claim_value_force_close(prev_commitment_tx: bool) {
411
411
claimable_amount_satoshis: 4_000 ,
412
412
claimable_height: htlc_cltv_timeout,
413
413
} ] ) ,
414
- sorted_vec( nodes[ 0 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
414
+ sorted_vec( nodes[ 0 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
415
415
connect_blocks ( & nodes[ 0 ] , ANTI_REORG_DELAY - 1 ) ;
416
416
assert_eq ! ( vec![ Balance :: MaybeClaimableHTLCAwaitingTimeout {
417
417
claimable_amount_satoshis: 4_000 ,
418
418
claimable_height: htlc_cltv_timeout,
419
419
} ] ,
420
- nodes[ 0 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
420
+ nodes[ 0 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
421
421
422
422
// When the HTLC timeout output is spendable in the next block, A should broadcast it
423
423
connect_blocks ( & nodes[ 0 ] , htlc_cltv_timeout - nodes[ 0 ] . best_block_info ( ) . 1 - 1 ) ;
@@ -442,12 +442,12 @@ fn do_test_claim_value_force_close(prev_commitment_tx: bool) {
442
442
claimable_amount_satoshis: 4_000 ,
443
443
confirmation_height: nodes[ 0 ] . best_block_info( ) . 1 + ANTI_REORG_DELAY - 1 ,
444
444
} ] ,
445
- nodes[ 0 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
445
+ nodes[ 0 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
446
446
// After ANTI_REORG_DELAY, A will generate a SpendableOutputs event and drop the claimable
447
447
// balance entry.
448
448
connect_blocks ( & nodes[ 0 ] , ANTI_REORG_DELAY - 1 ) ;
449
449
assert_eq ! ( Vec :: <Balance >:: new( ) ,
450
- nodes[ 0 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
450
+ nodes[ 0 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
451
451
expect_payment_failed ! ( nodes[ 0 ] , timeout_payment_hash, true ) ;
452
452
453
453
let mut node_a_spendable = nodes[ 0 ] . chain_monitor . chain_monitor . get_and_clear_pending_events ( ) ;
@@ -475,7 +475,7 @@ fn do_test_claim_value_force_close(prev_commitment_tx: bool) {
475
475
claimable_amount_satoshis: 4_000 ,
476
476
timeout_height: htlc_cltv_timeout,
477
477
} ] ) ,
478
- sorted_vec( nodes[ 1 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
478
+ sorted_vec( nodes[ 1 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
479
479
480
480
// After reaching the commitment output CSV, we'll get a SpendableOutputs event for it and have
481
481
// only the HTLCs claimable on node B.
@@ -497,7 +497,7 @@ fn do_test_claim_value_force_close(prev_commitment_tx: bool) {
497
497
claimable_amount_satoshis: 4_000 ,
498
498
timeout_height: htlc_cltv_timeout,
499
499
} ] ) ,
500
- sorted_vec( nodes[ 1 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
500
+ sorted_vec( nodes[ 1 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ) ;
501
501
502
502
// After reaching the claimed HTLC output CSV, we'll get a SpendableOutptus event for it and
503
503
// have only one HTLC output left spendable.
@@ -516,7 +516,7 @@ fn do_test_claim_value_force_close(prev_commitment_tx: bool) {
516
516
claimable_amount_satoshis: 4_000 ,
517
517
timeout_height: htlc_cltv_timeout,
518
518
} ] ,
519
- nodes[ 1 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
519
+ nodes[ 1 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
520
520
521
521
// Finally, mine the HTLC timeout transaction that A broadcasted (even though B should be able
522
522
// to claim this HTLC with the preimage it knows!). It will remain listed as a claimable HTLC
@@ -526,10 +526,10 @@ fn do_test_claim_value_force_close(prev_commitment_tx: bool) {
526
526
claimable_amount_satoshis: 4_000 ,
527
527
timeout_height: htlc_cltv_timeout,
528
528
} ] ,
529
- nodes[ 1 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
529
+ nodes[ 1 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
530
530
connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY - 1 ) ;
531
531
assert_eq ! ( Vec :: <Balance >:: new( ) ,
532
- nodes[ 1 ] . chain_monitor. chain_monitor. get_current_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
532
+ nodes[ 1 ] . chain_monitor. chain_monitor. get_monitor ( funding_outpoint) . unwrap( ) . get_claimable_balances( ) ) ;
533
533
}
534
534
535
535
#[ test]
0 commit comments