@@ -692,7 +692,7 @@ fn test_update_fee_that_funder_cannot_afford() {
692
692
let ( local_revocation_basepoint, local_htlc_basepoint, local_funding) = {
693
693
let per_peer_state = nodes[ 0 ] . node . per_peer_state . read ( ) . unwrap ( ) ;
694
694
let chan_lock = per_peer_state. get ( & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) . lock ( ) . unwrap ( ) ;
695
- let local_chan = chan_lock. channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
695
+ let local_chan = chan_lock. funded_channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
696
696
let chan_signer = local_chan. get_signer ( ) ;
697
697
let pubkeys = chan_signer. pubkeys ( ) ;
698
698
( pubkeys. revocation_basepoint , pubkeys. htlc_basepoint ,
@@ -701,7 +701,7 @@ fn test_update_fee_that_funder_cannot_afford() {
701
701
let ( remote_delayed_payment_basepoint, remote_htlc_basepoint, remote_point, remote_funding) = {
702
702
let per_peer_state = nodes[ 1 ] . node . per_peer_state . read ( ) . unwrap ( ) ;
703
703
let chan_lock = per_peer_state. get ( & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) . lock ( ) . unwrap ( ) ;
704
- let remote_chan = chan_lock. channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
704
+ let remote_chan = chan_lock. funded_channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
705
705
let chan_signer = remote_chan. get_signer ( ) ;
706
706
let pubkeys = chan_signer. pubkeys ( ) ;
707
707
( pubkeys. delayed_payment_basepoint , pubkeys. htlc_basepoint ,
@@ -716,7 +716,7 @@ fn test_update_fee_that_funder_cannot_afford() {
716
716
let res = {
717
717
let per_peer_state = nodes[ 0 ] . node . per_peer_state . read ( ) . unwrap ( ) ;
718
718
let local_chan_lock = per_peer_state. get ( & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) . lock ( ) . unwrap ( ) ;
719
- let local_chan = local_chan_lock. channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
719
+ let local_chan = local_chan_lock. funded_channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
720
720
let local_chan_signer = local_chan. get_signer ( ) ;
721
721
let mut htlcs: Vec < ( HTLCOutputInCommitment , ( ) ) > = vec ! [ ] ;
722
722
let commitment_tx = CommitmentTransaction :: new_with_auxiliary_htlc_data (
@@ -1394,7 +1394,7 @@ fn test_fee_spike_violation_fails_htlc() {
1394
1394
let ( local_revocation_basepoint, local_htlc_basepoint, local_secret, next_local_point, local_funding) = {
1395
1395
let per_peer_state = nodes[ 0 ] . node . per_peer_state . read ( ) . unwrap ( ) ;
1396
1396
let chan_lock = per_peer_state. get ( & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) . lock ( ) . unwrap ( ) ;
1397
- let local_chan = chan_lock. channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
1397
+ let local_chan = chan_lock. funded_channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
1398
1398
let chan_signer = local_chan. get_signer ( ) ;
1399
1399
// Make the signer believe we validated another commitment, so we can release the secret
1400
1400
chan_signer. get_enforcement_state ( ) . last_holder_commitment -= 1 ;
@@ -1408,7 +1408,7 @@ fn test_fee_spike_violation_fails_htlc() {
1408
1408
let ( remote_delayed_payment_basepoint, remote_htlc_basepoint, remote_point, remote_funding) = {
1409
1409
let per_peer_state = nodes[ 1 ] . node . per_peer_state . read ( ) . unwrap ( ) ;
1410
1410
let chan_lock = per_peer_state. get ( & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) . lock ( ) . unwrap ( ) ;
1411
- let remote_chan = chan_lock. channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
1411
+ let remote_chan = chan_lock. funded_channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
1412
1412
let chan_signer = remote_chan. get_signer ( ) ;
1413
1413
let pubkeys = chan_signer. pubkeys ( ) ;
1414
1414
( pubkeys. delayed_payment_basepoint , pubkeys. htlc_basepoint ,
@@ -1437,7 +1437,7 @@ fn test_fee_spike_violation_fails_htlc() {
1437
1437
let res = {
1438
1438
let per_peer_state = nodes[ 0 ] . node . per_peer_state . read ( ) . unwrap ( ) ;
1439
1439
let local_chan_lock = per_peer_state. get ( & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) . lock ( ) . unwrap ( ) ;
1440
- let local_chan = local_chan_lock. channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
1440
+ let local_chan = local_chan_lock. funded_channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
1441
1441
let local_chan_signer = local_chan. get_signer ( ) ;
1442
1442
let commitment_tx = CommitmentTransaction :: new_with_auxiliary_htlc_data (
1443
1443
commitment_number,
@@ -3080,7 +3080,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(deliver_bs_raa: bool, use
3080
3080
// The dust limit applied to HTLC outputs considers the fee of the HTLC transaction as
3081
3081
// well, so HTLCs at exactly the dust limit will not be included in commitment txn.
3082
3082
nodes[ 2 ] . node . per_peer_state . read ( ) . unwrap ( ) . get ( & nodes[ 1 ] . node . get_our_node_id ( ) )
3083
- . unwrap ( ) . lock ( ) . unwrap ( ) . channel_by_id . get ( & chan_2. 2 ) . unwrap ( ) . context . holder_dust_limit_satoshis * 1000
3083
+ . unwrap ( ) . lock ( ) . unwrap ( ) . funded_channel_by_id . get ( & chan_2. 2 ) . unwrap ( ) . context . holder_dust_limit_satoshis * 1000
3084
3084
} else { 3000000 } ;
3085
3085
3086
3086
let ( _, first_payment_hash, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , value) ;
@@ -4947,7 +4947,7 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
4947
4947
assert_eq ! ( get_local_commitment_txn!( nodes[ 3 ] , chan_2_3. 2 ) [ 0 ] . output. len( ) , 2 ) ;
4948
4948
4949
4949
let ds_dust_limit = nodes[ 3 ] . node . per_peer_state . read ( ) . unwrap ( ) . get ( & nodes[ 2 ] . node . get_our_node_id ( ) )
4950
- . unwrap ( ) . lock ( ) . unwrap ( ) . channel_by_id . get ( & chan_2_3. 2 ) . unwrap ( ) . context . holder_dust_limit_satoshis ;
4950
+ . unwrap ( ) . lock ( ) . unwrap ( ) . funded_channel_by_id . get ( & chan_2_3. 2 ) . unwrap ( ) . context . holder_dust_limit_satoshis ;
4951
4951
// 0th HTLC:
4952
4952
let ( _, payment_hash_1, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 4 ] ] , ds_dust_limit* 1000 ) ; // not added < dust limit + HTLC tx fee
4953
4953
// 1st HTLC:
@@ -6060,7 +6060,7 @@ fn test_update_add_htlc_bolt2_sender_exceed_max_htlc_num_and_htlc_id_increment()
6060
6060
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
6061
6061
let chan = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 1000000 , 0 ) ;
6062
6062
let max_accepted_htlcs = nodes[ 1 ] . node . per_peer_state . read ( ) . unwrap ( ) . get ( & nodes[ 0 ] . node . get_our_node_id ( ) )
6063
- . unwrap ( ) . lock ( ) . unwrap ( ) . channel_by_id . get ( & chan. 2 ) . unwrap ( ) . context . counterparty_max_accepted_htlcs as u64 ;
6063
+ . unwrap ( ) . lock ( ) . unwrap ( ) . funded_channel_by_id . get ( & chan. 2 ) . unwrap ( ) . context . counterparty_max_accepted_htlcs as u64 ;
6064
6064
6065
6065
for i in 0 ..max_accepted_htlcs {
6066
6066
let ( route, our_payment_hash, _, our_payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 100000 ) ;
@@ -6131,7 +6131,7 @@ fn test_update_add_htlc_bolt2_receiver_check_amount_received_more_than_min() {
6131
6131
{
6132
6132
let per_peer_state = nodes[ 0 ] . node . per_peer_state . read ( ) . unwrap ( ) ;
6133
6133
let chan_lock = per_peer_state. get ( & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) . lock ( ) . unwrap ( ) ;
6134
- let channel = chan_lock. channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
6134
+ let channel = chan_lock. funded_channel_by_id . get ( & chan. 2 ) . unwrap ( ) ;
6135
6135
htlc_minimum_msat = channel. get_holder_htlc_minimum_msat ( ) ;
6136
6136
}
6137
6137
@@ -6715,7 +6715,7 @@ fn do_test_failure_delay_dust_htlc_local_commitment(announce_latest: bool) {
6715
6715
let chan =create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
6716
6716
6717
6717
let bs_dust_limit = nodes[ 1 ] . node . per_peer_state . read ( ) . unwrap ( ) . get ( & nodes[ 0 ] . node . get_our_node_id ( ) )
6718
- . unwrap ( ) . lock ( ) . unwrap ( ) . channel_by_id . get ( & chan. 2 ) . unwrap ( ) . context . holder_dust_limit_satoshis ;
6718
+ . unwrap ( ) . lock ( ) . unwrap ( ) . funded_channel_by_id . get ( & chan. 2 ) . unwrap ( ) . context . holder_dust_limit_satoshis ;
6719
6719
6720
6720
// We route 2 dust-HTLCs between A and B
6721
6721
let ( _, payment_hash_1, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , bs_dust_limit* 1000 ) ;
@@ -6808,7 +6808,7 @@ fn do_test_sweep_outbound_htlc_failure_update(revoked: bool, local: bool) {
6808
6808
let chan = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
6809
6809
6810
6810
let bs_dust_limit = nodes[ 1 ] . node . per_peer_state . read ( ) . unwrap ( ) . get ( & nodes[ 0 ] . node . get_our_node_id ( ) )
6811
- . unwrap ( ) . lock ( ) . unwrap ( ) . channel_by_id . get ( & chan. 2 ) . unwrap ( ) . context . holder_dust_limit_satoshis ;
6811
+ . unwrap ( ) . lock ( ) . unwrap ( ) . funded_channel_by_id . get ( & chan. 2 ) . unwrap ( ) . context . holder_dust_limit_satoshis ;
6812
6812
6813
6813
let ( _payment_preimage_1, dust_hash, _payment_secret_1) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , bs_dust_limit* 1000 ) ;
6814
6814
let ( _payment_preimage_2, non_dust_hash, _payment_secret_2) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 1000000 ) ;
@@ -7473,7 +7473,7 @@ fn test_counterparty_raa_skip_no_crash() {
7473
7473
{
7474
7474
let per_peer_state = nodes[ 0 ] . node . per_peer_state . read ( ) . unwrap ( ) ;
7475
7475
let mut guard = per_peer_state. get ( & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) . lock ( ) . unwrap ( ) ;
7476
- let keys = guard. channel_by_id . get_mut ( & channel_id) . unwrap ( ) . get_signer ( ) ;
7476
+ let keys = guard. funded_channel_by_id . get_mut ( & channel_id) . unwrap ( ) . get_signer ( ) ;
7477
7477
7478
7478
const INITIAL_COMMITMENT_NUMBER : u64 = ( 1 << 48 ) - 1 ;
7479
7479
@@ -8727,7 +8727,7 @@ fn test_duplicate_chan_id() {
8727
8727
// another channel in the ChannelManager - an invalid state. Thus, we'd panic later when we
8728
8728
// try to create another channel. Instead, we drop the channel entirely here (leaving the
8729
8729
// channelmanager in a possibly nonsense state instead).
8730
- let mut as_chan = a_peer_state. channel_by_id . remove ( & open_chan_2_msg. temporary_channel_id ) . unwrap ( ) ;
8730
+ let mut as_chan = a_peer_state. funded_channel_by_id . remove ( & open_chan_2_msg. temporary_channel_id ) . unwrap ( ) ;
8731
8731
let logger = test_utils:: TestLogger :: new ( ) ;
8732
8732
as_chan. get_outbound_funding_created ( tx. clone ( ) , funding_outpoint, & & logger) . unwrap ( )
8733
8733
} ;
@@ -9418,7 +9418,7 @@ fn do_test_max_dust_htlc_exposure(dust_outbound_balance: bool, exposure_breach_e
9418
9418
let dust_buffer_feerate = {
9419
9419
let per_peer_state = nodes[ 0 ] . node . per_peer_state . read ( ) . unwrap ( ) ;
9420
9420
let chan_lock = per_peer_state. get ( & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) . lock ( ) . unwrap ( ) ;
9421
- let chan = chan_lock. channel_by_id . get ( & channel_id) . unwrap ( ) ;
9421
+ let chan = chan_lock. funded_channel_by_id . get ( & channel_id) . unwrap ( ) ;
9422
9422
chan. get_dust_buffer_feerate ( None ) as u64
9423
9423
} ;
9424
9424
let dust_outbound_htlc_on_holder_tx_msat: u64 = ( dust_buffer_feerate * htlc_timeout_tx_weight ( opt_anchors) / 1000 + open_channel. dust_limit_satoshis - 1 ) * 1000 ;
0 commit comments