@@ -3595,15 +3595,11 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
3595
3595
3596
3596
// Public utilities:
3597
3597
3598
- pub fn channel_id ( & self ) -> [ u8 ; 32 ] {
3599
- self . channel_id
3600
- }
3598
+ pub fn channel_id ( & self ) -> [ u8 ; 32 ] { self . channel_id }
3601
3599
3602
3600
/// Gets the "user_id" value passed into the construction of this channel. It has no special
3603
3601
/// meaning and exists only to allow users to have a persistent identifier of a channel.
3604
- pub fn get_user_id ( & self ) -> u64 {
3605
- self . user_id
3606
- }
3602
+ pub fn get_user_id ( & self ) -> u64 { self . user_id }
3607
3603
3608
3604
/// May only be called after funding has been initiated (ie is_funding_initiated() is true)
3609
3605
pub fn channel_monitor ( & mut self ) -> & mut ChannelMonitor {
@@ -3616,43 +3612,27 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
3616
3612
/// Guaranteed to be Some after both FundingLocked messages have been exchanged (and, thus,
3617
3613
/// is_usable() returns true).
3618
3614
/// Allowed in any state (including after shutdown)
3619
- pub fn get_short_channel_id ( & self ) -> Option < u64 > {
3620
- self . short_channel_id
3621
- }
3615
+ pub fn get_short_channel_id ( & self ) -> Option < u64 > { self . short_channel_id }
3622
3616
3623
3617
/// Returns the funding_txo we either got from our peer, or were given by
3624
3618
/// get_outbound_funding_created.
3625
- pub fn get_funding_txo ( & self ) -> Option < OutPoint > {
3626
- self . channel_monitor . get_funding_txo ( )
3627
- }
3619
+ pub fn get_funding_txo ( & self ) -> Option < OutPoint > { self . channel_monitor . get_funding_txo ( ) }
3628
3620
3629
3621
/// Allowed in any state (including after shutdown)
3630
- pub fn get_their_node_id ( & self ) -> PublicKey {
3631
- self . their_node_id
3632
- }
3622
+ pub fn get_their_node_id ( & self ) -> PublicKey { self . their_node_id }
3633
3623
3634
3624
/// Allowed in any state (including after shutdown)
3635
- pub fn get_our_htlc_minimum_msat ( & self ) -> u64 {
3636
- self . our_htlc_minimum_msat
3637
- }
3625
+ pub fn get_our_htlc_minimum_msat ( & self ) -> u64 { self . our_htlc_minimum_msat }
3638
3626
3639
3627
/// Allowed in any state (including after shutdown)
3640
- pub fn get_their_htlc_minimum_msat ( & self ) -> u64 {
3641
- self . our_htlc_minimum_msat
3642
- }
3628
+ pub fn get_their_htlc_minimum_msat ( & self ) -> u64 { self . our_htlc_minimum_msat }
3643
3629
3644
- pub fn get_value_satoshis ( & self ) -> u64 {
3645
- self . channel_value_satoshis
3646
- }
3630
+ pub fn get_value_satoshis ( & self ) -> u64 { self . channel_value_satoshis }
3647
3631
3648
- pub fn get_fee_proportional_millionths ( & self ) -> u32 {
3649
- self . config . fee_proportional_millionths
3650
- }
3632
+ pub fn get_fee_proportional_millionths ( & self ) -> u32 { self . config . fee_proportional_millionths }
3651
3633
3652
3634
#[ cfg( test) ]
3653
- pub fn get_feerate ( & self ) -> u64 {
3654
- self . feerate_per_kw
3655
- }
3635
+ pub fn get_feerate ( & self ) -> u64 { self . feerate_per_kw }
3656
3636
3657
3637
pub fn get_cur_local_commitment_transaction_number ( & self ) -> u64 {
3658
3638
self . cur_local_commitment_transaction_number + 1
@@ -3672,9 +3652,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
3672
3652
}
3673
3653
3674
3654
#[ cfg( test) ]
3675
- pub fn get_local_keys ( & self ) -> & ChanSigner {
3676
- & self . local_keys
3677
- }
3655
+ pub fn get_local_keys ( & self ) -> & ChanSigner { & self . local_keys }
3678
3656
3679
3657
#[ cfg( test) ]
3680
3658
pub fn get_value_stat ( & self ) -> ChannelValueStat {
@@ -3705,17 +3683,11 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
3705
3683
}
3706
3684
3707
3685
/// Allowed in any state (including after shutdown)
3708
- pub fn get_channel_update_count ( & self ) -> u32 {
3709
- self . channel_update_count
3710
- }
3686
+ pub fn get_channel_update_count ( & self ) -> u32 { self . channel_update_count }
3711
3687
3712
- pub fn should_announce ( & self ) -> bool {
3713
- self . config . announced_channel
3714
- }
3688
+ pub fn should_announce ( & self ) -> bool { self . config . announced_channel }
3715
3689
3716
- pub fn is_outbound ( & self ) -> bool {
3717
- self . channel_outbound
3718
- }
3690
+ pub fn is_outbound ( & self ) -> bool { self . channel_outbound }
3719
3691
3720
3692
/// Gets the fee we'd want to charge for adding an HTLC output to this Channel
3721
3693
/// Allowed in any state (including after shutdown)
@@ -3740,9 +3712,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
3740
3712
}
3741
3713
3742
3714
/// Returns true if we've ever received a message from the remote end for this Channel
3743
- pub fn have_received_message ( & self ) -> bool {
3744
- self . channel_state > ( ChannelState :: OurInitSent as u32 )
3745
- }
3715
+ pub fn have_received_message ( & self ) -> bool { self . channel_state > ( ChannelState :: OurInitSent as u32 ) }
3746
3716
3747
3717
/// Returns true if this channel is fully established and not known to be closing.
3748
3718
/// Allowed in any state (including after shutdown)
@@ -3767,9 +3737,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
3767
3737
}
3768
3738
3769
3739
/// Returns true if funding_created was sent/received.
3770
- pub fn is_funding_initiated ( & self ) -> bool {
3771
- self . channel_state >= ChannelState :: FundingCreated as u32
3772
- }
3740
+ pub fn is_funding_initiated ( & self ) -> bool { self . channel_state >= ChannelState :: FundingCreated as u32 }
3773
3741
3774
3742
/// Returns true if this channel is fully shut down. True here implies that no further actions
3775
3743
/// may/will be taken on this channel, and thus this object should be freed. Any future changes
@@ -3783,25 +3751,15 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
3783
3751
}
3784
3752
}
3785
3753
3786
- pub fn to_disabled_staged ( & mut self ) {
3787
- self . network_sync = UpdateStatus :: DisabledStaged ;
3788
- }
3754
+ pub fn to_disabled_staged ( & mut self ) { self . network_sync = UpdateStatus :: DisabledStaged ; }
3789
3755
3790
- pub fn to_disabled_marked ( & mut self ) {
3791
- self . network_sync = UpdateStatus :: DisabledMarked ;
3792
- }
3756
+ pub fn to_disabled_marked ( & mut self ) { self . network_sync = UpdateStatus :: DisabledMarked ; }
3793
3757
3794
- pub fn to_fresh ( & mut self ) {
3795
- self . network_sync = UpdateStatus :: Fresh ;
3796
- }
3758
+ pub fn to_fresh ( & mut self ) { self . network_sync = UpdateStatus :: Fresh ; }
3797
3759
3798
- pub fn is_disabled_staged ( & self ) -> bool {
3799
- self . network_sync == UpdateStatus :: DisabledStaged
3800
- }
3760
+ pub fn is_disabled_staged ( & self ) -> bool { self . network_sync == UpdateStatus :: DisabledStaged }
3801
3761
3802
- pub fn is_disabled_marked ( & self ) -> bool {
3803
- self . network_sync == UpdateStatus :: DisabledMarked
3804
- }
3762
+ pub fn is_disabled_marked ( & self ) -> bool { self . network_sync == UpdateStatus :: DisabledMarked }
3805
3763
3806
3764
/// Called by channelmanager based on chain blocks being connected.
3807
3765
/// Note that we only need to use this to detect funding_signed, anything else is handled by
@@ -5116,9 +5074,7 @@ mod tests {
5116
5074
fee_est : u64 ,
5117
5075
}
5118
5076
impl FeeEstimator for TestFeeEstimator {
5119
- fn get_est_sat_per_1000_weight ( & self , _: ConfirmationTarget ) -> u64 {
5120
- self . fee_est
5121
- }
5077
+ fn get_est_sat_per_1000_weight ( & self , _: ConfirmationTarget ) -> u64 { self . fee_est }
5122
5078
}
5123
5079
5124
5080
#[ test]
@@ -5160,15 +5116,11 @@ mod tests {
5160
5116
PublicKey :: from_secret_key ( & secp_ctx, & channel_close_key)
5161
5117
}
5162
5118
5163
- fn get_channel_keys ( & self , _inbound : bool ) -> InMemoryChannelKeys {
5164
- self . chan_keys . clone ( )
5165
- }
5119
+ fn get_channel_keys ( & self , _inbound : bool ) -> InMemoryChannelKeys { self . chan_keys . clone ( ) }
5166
5120
fn get_onion_rand ( & self ) -> ( SecretKey , [ u8 ; 32 ] ) {
5167
5121
panic ! ( ) ;
5168
5122
}
5169
- fn get_channel_id ( & self ) -> [ u8 ; 32 ] {
5170
- [ 0 ; 32 ]
5171
- }
5123
+ fn get_channel_id ( & self ) -> [ u8 ; 32 ] { [ 0 ; 32 ] }
5172
5124
}
5173
5125
5174
5126
#[ test]
0 commit comments