@@ -1965,8 +1965,7 @@ impl Node {
19651965 /// Call this when a deposit to a SIP address is detected on-chain. In production this
19661966 /// would be driven by chain sync; for testing it can be called manually.
19671967 pub fn register_sip_utxo (
1968- & self , outpoint : OutPoint , value : Amount , address_index : u32 ,
1969- prevtx : Transaction ,
1968+ & self , outpoint : OutPoint , value : Amount , address_index : u32 , prevtx : Transaction ,
19701969 ) -> Result < ( ) , Error > {
19711970 let sip = self . sip_manager . as_ref ( ) . ok_or ( Error :: LiquiditySourceUnavailable ) ?;
19721971 sip. wallet ( ) . register_utxo ( outpoint, value, address_index, prevtx) ;
@@ -2058,16 +2057,13 @@ impl Node {
20582057 // Create channel directly, bypassing check_sufficient_funds_for_channel
20592058 // since the funds come from SIP UTXOs, not the regular BDK wallet.
20602059 let user_channel_id: u128 = u128:: from_ne_bytes (
2061- self . keys_manager . get_secure_random_bytes ( ) [ ..16 ]
2062- . try_into ( )
2063- . expect ( "16-byte slice" ) ,
2060+ self . keys_manager . get_secure_random_bytes ( ) [ ..16 ] . try_into ( ) . expect ( "16-byte slice" ) ,
20642061 ) ;
20652062
20662063 let mut user_config = default_user_config ( & self . config ) ;
20672064 user_config. channel_handshake_config . announce_for_forwarding = false ;
2068- user_config
2069- . channel_handshake_config
2070- . max_inbound_htlc_value_in_flight_percent_of_channel = 100 ;
2065+ user_config. channel_handshake_config . max_inbound_htlc_value_in_flight_percent_of_channel =
2066+ 100 ;
20712067
20722068 self . channel_manager
20732069 . create_channel (
@@ -2120,8 +2116,9 @@ impl Node {
21202116 Error :: ChannelSplicingFailed
21212117 } ) ?;
21222118
2123- let min_feerate =
2124- self . fee_estimator . estimate_fee_rate ( crate :: fee_estimator:: ConfirmationTarget :: ChannelFunding ) ;
2119+ let min_feerate = self
2120+ . fee_estimator
2121+ . estimate_fee_rate ( crate :: fee_estimator:: ConfirmationTarget :: ChannelFunding ) ;
21252122 let max_feerate = FeeRate :: from_sat_per_kwu ( min_feerate. to_sat_per_kwu ( ) * 3 / 2 ) ;
21262123
21272124 let funding_template = self
@@ -2132,7 +2129,8 @@ impl Node {
21322129 Error :: ChannelSplicingFailed
21332130 } ) ?;
21342131
2135- let sip_coin_source = crate :: sip:: coin_selection:: SipCoinSelectionSource :: new ( sip. wallet_arc ( ) ) ;
2132+ let sip_coin_source =
2133+ crate :: sip:: coin_selection:: SipCoinSelectionSource :: new ( sip. wallet_arc ( ) ) ;
21362134 let contribution = self
21372135 . runtime
21382136 . block_on ( funding_template. splice_in (
@@ -2216,11 +2214,7 @@ impl Node {
22162214
22172215 for ( input_idx, outpoint) in & pending. sip_inputs {
22182216 let server_sig = sip_signatures. get ( outpoint) . ok_or_else ( || {
2219- log_error ! (
2220- self . logger,
2221- "Missing server signature for SIP input {}" ,
2222- outpoint
2223- ) ;
2217+ log_error ! ( self . logger, "Missing server signature for SIP input {}" , outpoint) ;
22242218 Error :: ChannelSplicingFailed
22252219 } ) ?;
22262220
@@ -2267,22 +2261,14 @@ impl Node {
22672261
22682262 if pending. is_v1_open {
22692263 self . channel_manager
2270- . funding_transaction_generated (
2271- * channel_id,
2272- pending. counterparty_node_id ,
2273- tx,
2274- )
2264+ . funding_transaction_generated ( * channel_id, pending. counterparty_node_id , tx)
22752265 . map_err ( |e| {
22762266 log_error ! ( self . logger, "Failed to complete SIP channel open: {:?}" , e) ;
22772267 Error :: ChannelCreationFailed
22782268 } )
22792269 } else {
22802270 self . channel_manager
2281- . funding_transaction_signed (
2282- channel_id,
2283- & pending. counterparty_node_id ,
2284- tx,
2285- )
2271+ . funding_transaction_signed ( channel_id, & pending. counterparty_node_id , tx)
22862272 . map_err ( |e| {
22872273 log_error ! ( self . logger, "Failed to complete SIP splice funding: {:?}" , e) ;
22882274 Error :: ChannelSplicingFailed
@@ -2291,9 +2277,7 @@ impl Node {
22912277 }
22922278
22932279 /// Marks a SIP UTXO as refunded after the refund transaction has been broadcast.
2294- pub fn mark_sip_refunded (
2295- & self , outpoint : & OutPoint , spending_txid : Txid ,
2296- ) -> Result < ( ) , Error > {
2280+ pub fn mark_sip_refunded ( & self , outpoint : & OutPoint , spending_txid : Txid ) -> Result < ( ) , Error > {
22972281 let sip = self . sip_manager . as_ref ( ) . ok_or ( Error :: LiquiditySourceUnavailable ) ?;
22982282 sip. wallet ( ) . mark_refunded ( outpoint, spending_txid) ;
22992283 Ok ( ( ) )
0 commit comments