@@ -290,7 +290,7 @@ impl<Key : Send + cmp::Eq + hash::Hash + 'static, ChanSigner: ChannelKeys, T: De
290290 hash_map:: Entry :: Occupied ( _) => return Err ( MonitorUpdateError ( "Channel monitor for given key is already present" ) ) ,
291291 hash_map:: Entry :: Vacant ( e) => e,
292292 } ;
293- match monitor. onchain_detection . funding_info {
293+ match monitor. funding_info {
294294 None => {
295295 return Err ( MonitorUpdateError ( "Try to update a useless monitor without funding_txo !" ) ) ;
296296 } ,
@@ -314,7 +314,7 @@ impl<Key : Send + cmp::Eq + hash::Hash + 'static, ChanSigner: ChannelKeys, T: De
314314 let mut monitors = self . monitors . lock ( ) . unwrap ( ) ;
315315 match monitors. get_mut ( & key) {
316316 Some ( orig_monitor) => {
317- log_trace ! ( self , "Updating Channel Monitor for channel {}" , log_funding_info!( orig_monitor. onchain_detection ) ) ;
317+ log_trace ! ( self , "Updating Channel Monitor for channel {}" , log_funding_info!( orig_monitor) ) ;
318318 orig_monitor. update_monitor ( update, & self . broadcaster )
319319 } ,
320320 None => Err ( MonitorUpdateError ( "No such monitor registered" ) )
@@ -391,20 +391,6 @@ pub(crate) const LATENCY_GRACE_PERIOD_BLOCKS: u32 = 3;
391391/// keeping bumping another claim tx to solve the outpoint.
392392pub ( crate ) const ANTI_REORG_DELAY : u32 = 6 ;
393393
394- struct OnchainDetection < ChanSigner : ChannelKeys > {
395- keys : ChanSigner ,
396- funding_info : Option < ( OutPoint , Script ) > ,
397- current_remote_commitment_txid : Option < Sha256dHash > ,
398- prev_remote_commitment_txid : Option < Sha256dHash > ,
399- }
400-
401- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
402- impl < ChanSigner : ChannelKeys > PartialEq for OnchainDetection < ChanSigner > {
403- fn eq ( & self , other : & Self ) -> bool {
404- self . keys . pubkeys ( ) == other. keys . pubkeys ( )
405- }
406- }
407-
408394#[ derive( Clone , PartialEq ) ]
409395struct LocalSignedTx {
410396 /// txid of the transaction in tx, just used to make comparison faster
@@ -734,7 +720,11 @@ pub struct ChannelMonitor<ChanSigner: ChannelKeys> {
734720 broadcasted_remote_payment_script : Option < ( Script , SecretKey ) > ,
735721 shutdown_script : Script ,
736722
737- onchain_detection : OnchainDetection < ChanSigner > ,
723+ keys : ChanSigner ,
724+ funding_info : Option < ( OutPoint , Script ) > ,
725+ current_remote_commitment_txid : Option < Sha256dHash > ,
726+ prev_remote_commitment_txid : Option < Sha256dHash > ,
727+
738728 their_htlc_base_key : Option < PublicKey > ,
739729 their_delayed_payment_base_key : Option < PublicKey > ,
740730 funding_redeemscript : Option < Script > ,
@@ -817,7 +807,10 @@ impl<ChanSigner: ChannelKeys> PartialEq for ChannelMonitor<ChanSigner> {
817807 self . destination_script != other. destination_script ||
818808 self . broadcasted_local_revokable_script != other. broadcasted_local_revokable_script ||
819809 self . broadcasted_remote_payment_script != other. broadcasted_remote_payment_script ||
820- self . onchain_detection != other. onchain_detection ||
810+ self . keys . pubkeys ( ) != other. keys . pubkeys ( ) ||
811+ self . funding_info != other. funding_info ||
812+ self . current_remote_commitment_txid != other. current_remote_commitment_txid ||
813+ self . prev_remote_commitment_txid != other. prev_remote_commitment_txid ||
821814 self . their_htlc_base_key != other. their_htlc_base_key ||
822815 self . their_delayed_payment_base_key != other. their_delayed_payment_base_key ||
823816 self . funding_redeemscript != other. funding_redeemscript ||
@@ -878,8 +871,8 @@ impl<ChanSigner: ChannelKeys + Writeable> ChannelMonitor<ChanSigner> {
878871 }
879872 self . shutdown_script . write ( writer) ?;
880873
881- self . onchain_detection . keys . write ( writer) ?;
882- match self . onchain_detection . funding_info {
874+ self . keys . write ( writer) ?;
875+ match self . funding_info {
883876 Some ( ( ref outpoint, ref script) ) => {
884877 writer. write_all ( & outpoint. txid [ ..] ) ?;
885878 writer. write_all ( & byte_utils:: be16_to_array ( outpoint. index ) ) ?;
@@ -889,8 +882,8 @@ impl<ChanSigner: ChannelKeys + Writeable> ChannelMonitor<ChanSigner> {
889882 debug_assert ! ( false , "Try to serialize a useless Local monitor !" ) ;
890883 } ,
891884 }
892- self . onchain_detection . current_remote_commitment_txid . write ( writer) ?;
893- self . onchain_detection . prev_remote_commitment_txid . write ( writer) ?;
885+ self . current_remote_commitment_txid . write ( writer) ?;
886+ self . prev_remote_commitment_txid . write ( writer) ?;
894887
895888 writer. write_all ( & self . their_htlc_base_key . as_ref ( ) . unwrap ( ) . serialize ( ) ) ?;
896889 writer. write_all ( & self . their_delayed_payment_base_key . as_ref ( ) . unwrap ( ) . serialize ( ) ) ?;
@@ -1096,13 +1089,6 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
10961089 let our_channel_close_key_hash = Hash160 :: hash ( & shutdown_pubkey. serialize ( ) ) ;
10971090 let shutdown_script = Builder :: new ( ) . push_opcode ( opcodes:: all:: OP_PUSHBYTES_0 ) . push_slice ( & our_channel_close_key_hash[ ..] ) . into_script ( ) ;
10981091
1099- let onchain_detection = OnchainDetection {
1100- keys : keys. clone ( ) ,
1101- funding_info : Some ( funding_info) ,
1102- current_remote_commitment_txid : None ,
1103- prev_remote_commitment_txid : None ,
1104- } ;
1105-
11061092 ChannelMonitor {
11071093 latest_update_id : 0 ,
11081094 commitment_transaction_number_obscure_factor,
@@ -1112,7 +1098,11 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
11121098 broadcasted_remote_payment_script : None ,
11131099 shutdown_script,
11141100
1115- onchain_detection : onchain_detection,
1101+ keys : keys. clone ( ) ,
1102+ funding_info : Some ( funding_info) ,
1103+ current_remote_commitment_txid : None ,
1104+ prev_remote_commitment_txid : None ,
1105+
11161106 their_htlc_base_key : Some ( their_htlc_base_key. clone ( ) ) ,
11171107 their_delayed_payment_base_key : Some ( their_delayed_payment_base_key. clone ( ) ) ,
11181108 funding_redeemscript : Some ( funding_redeemscript. clone ( ) ) ,
@@ -1159,7 +1149,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
11591149
11601150 // Prune HTLCs from the previous remote commitment tx so we don't generate failure/fulfill
11611151 // events for now-revoked/fulfilled HTLCs.
1162- if let Some ( txid) = self . onchain_detection . prev_remote_commitment_txid . take ( ) {
1152+ if let Some ( txid) = self . prev_remote_commitment_txid . take ( ) {
11631153 for & mut ( _, ref mut source) in self . remote_claimable_outpoints . get_mut ( & txid) . unwrap ( ) {
11641154 * source = None ;
11651155 }
@@ -1216,8 +1206,8 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
12161206 let new_txid = unsigned_commitment_tx. txid ( ) ;
12171207 log_trace ! ( self , "Tracking new remote commitment transaction with txid {} at commitment number {} with {} HTLC outputs" , new_txid, commitment_number, htlc_outputs. len( ) ) ;
12181208 log_trace ! ( self , "New potential remote commitment transaction: {}" , encode:: serialize_hex( unsigned_commitment_tx) ) ;
1219- self . onchain_detection . prev_remote_commitment_txid = self . onchain_detection . current_remote_commitment_txid . take ( ) ;
1220- self . onchain_detection . current_remote_commitment_txid = Some ( new_txid) ;
1209+ self . prev_remote_commitment_txid = self . current_remote_commitment_txid . take ( ) ;
1210+ self . current_remote_commitment_txid = Some ( new_txid) ;
12211211 self . remote_claimable_outpoints . insert ( new_txid, htlc_outputs) ;
12221212 self . current_remote_commitment_number = commitment_number;
12231213 //TODO: Merge this into the other per-remote-transaction output storage stuff
@@ -1242,11 +1232,11 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
12421232 }
12431233
12441234 pub ( super ) fn provide_rescue_remote_commitment_tx_info ( & mut self , their_revocation_point : PublicKey ) {
1245- if let Ok ( payment_key) = chan_utils:: derive_public_key ( & self . secp_ctx , & their_revocation_point, & self . onchain_detection . keys . pubkeys ( ) . payment_basepoint ) {
1235+ if let Ok ( payment_key) = chan_utils:: derive_public_key ( & self . secp_ctx , & their_revocation_point, & self . keys . pubkeys ( ) . payment_basepoint ) {
12461236 let to_remote_script = Builder :: new ( ) . push_opcode ( opcodes:: all:: OP_PUSHBYTES_0 )
12471237 . push_slice ( & Hash160 :: hash ( & payment_key. serialize ( ) ) [ ..] )
12481238 . into_script ( ) ;
1249- if let Ok ( to_remote_key) = chan_utils:: derive_private_key ( & self . secp_ctx , & their_revocation_point, & self . onchain_detection . keys . payment_base_key ( ) ) {
1239+ if let Ok ( to_remote_key) = chan_utils:: derive_private_key ( & self . secp_ctx , & their_revocation_point, & self . keys . payment_base_key ( ) ) {
12501240 self . broadcasted_remote_payment_script = Some ( ( to_remote_script, to_remote_key) ) ;
12511241 }
12521242 }
@@ -1377,7 +1367,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
13771367
13781368 /// Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
13791369 pub fn get_funding_txo ( & self ) -> Option < OutPoint > {
1380- if let Some ( ( outp, _) ) = self . onchain_detection . funding_info {
1370+ if let Some ( ( outp, _) ) = self . funding_info {
13811371 return Some ( outp)
13821372 }
13831373 None
@@ -1469,10 +1459,10 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
14691459 let secret = self . get_secret ( commitment_number) . unwrap ( ) ;
14701460 let per_commitment_key = ignore_error ! ( SecretKey :: from_slice( & secret) ) ;
14711461 let per_commitment_point = PublicKey :: from_secret_key ( & self . secp_ctx , & per_commitment_key) ;
1472- let revocation_pubkey = ignore_error ! ( chan_utils:: derive_public_revocation_key( & self . secp_ctx, & per_commitment_point, & self . onchain_detection . keys. pubkeys( ) . revocation_basepoint) ) ;
1473- let revocation_key = ignore_error ! ( chan_utils:: derive_private_revocation_key( & self . secp_ctx, & per_commitment_key, & self . onchain_detection . keys. revocation_base_key( ) ) ) ;
1474- let b_htlc_key = ignore_error ! ( chan_utils:: derive_public_key( & self . secp_ctx, & per_commitment_point, & self . onchain_detection . keys. pubkeys( ) . htlc_basepoint) ) ;
1475- let local_payment_key = ignore_error ! ( chan_utils:: derive_private_key( & self . secp_ctx, & per_commitment_point, & self . onchain_detection . keys. payment_base_key( ) ) ) ;
1462+ let revocation_pubkey = ignore_error ! ( chan_utils:: derive_public_revocation_key( & self . secp_ctx, & per_commitment_point, & self . keys. pubkeys( ) . revocation_basepoint) ) ;
1463+ let revocation_key = ignore_error ! ( chan_utils:: derive_private_revocation_key( & self . secp_ctx, & per_commitment_key, & self . keys. revocation_base_key( ) ) ) ;
1464+ let b_htlc_key = ignore_error ! ( chan_utils:: derive_public_key( & self . secp_ctx, & per_commitment_point, & self . keys. pubkeys( ) . htlc_basepoint) ) ;
1465+ let local_payment_key = ignore_error ! ( chan_utils:: derive_private_key( & self . secp_ctx, & per_commitment_point, & self . keys. payment_base_key( ) ) ) ;
14761466 let delayed_key = ignore_error ! ( chan_utils:: derive_public_key( & self . secp_ctx, & PublicKey :: from_secret_key( & self . secp_ctx, & per_commitment_key) , & self . their_delayed_payment_base_key. unwrap( ) ) ) ;
14771467 let a_htlc_key = match self . their_htlc_base_key {
14781468 None => return ( claimable_outpoints, ( commitment_txid, watch_outputs) ) ,
@@ -1548,10 +1538,10 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
15481538 }
15491539 }
15501540 }
1551- if let Some ( ref txid) = self . onchain_detection . current_remote_commitment_txid {
1541+ if let Some ( ref txid) = self . current_remote_commitment_txid {
15521542 check_htlc_fails ! ( txid, "current" ) ;
15531543 }
1554- if let Some ( ref txid) = self . onchain_detection . prev_remote_commitment_txid {
1544+ if let Some ( ref txid) = self . prev_remote_commitment_txid {
15551545 check_htlc_fails ! ( txid, "remote" ) ;
15561546 }
15571547 // No need to check local commitment txn, symmetric HTLCSource must be present as per-htlc data on remote commitment tx
@@ -1611,10 +1601,10 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
16111601 }
16121602 }
16131603 }
1614- if let Some ( ref txid) = self . onchain_detection . current_remote_commitment_txid {
1604+ if let Some ( ref txid) = self . current_remote_commitment_txid {
16151605 check_htlc_fails ! ( txid, "current" , ' current_loop) ;
16161606 }
1617- if let Some ( ref txid) = self . onchain_detection . prev_remote_commitment_txid {
1607+ if let Some ( ref txid) = self . prev_remote_commitment_txid {
16181608 check_htlc_fails ! ( txid, "previous" , ' prev_loop) ;
16191609 }
16201610
@@ -1625,14 +1615,14 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
16251615 if revocation_points. 0 == commitment_number + 1 { Some ( point) } else { None }
16261616 } else { None } ;
16271617 if let Some ( revocation_point) = revocation_point_option {
1628- let revocation_pubkey = ignore_error ! ( chan_utils:: derive_public_revocation_key( & self . secp_ctx, revocation_point, & self . onchain_detection . keys. pubkeys( ) . revocation_basepoint) ) ;
1629- let b_htlc_key = ignore_error ! ( chan_utils:: derive_public_key( & self . secp_ctx, revocation_point, & self . onchain_detection . keys. pubkeys( ) . htlc_basepoint) ) ;
1630- let htlc_privkey = ignore_error ! ( chan_utils:: derive_private_key( & self . secp_ctx, revocation_point, & self . onchain_detection . keys. htlc_base_key( ) ) ) ;
1618+ let revocation_pubkey = ignore_error ! ( chan_utils:: derive_public_revocation_key( & self . secp_ctx, revocation_point, & self . keys. pubkeys( ) . revocation_basepoint) ) ;
1619+ let b_htlc_key = ignore_error ! ( chan_utils:: derive_public_key( & self . secp_ctx, revocation_point, & self . keys. pubkeys( ) . htlc_basepoint) ) ;
1620+ let htlc_privkey = ignore_error ! ( chan_utils:: derive_private_key( & self . secp_ctx, revocation_point, & self . keys. htlc_base_key( ) ) ) ;
16311621 let a_htlc_key = match self . their_htlc_base_key {
16321622 None => return ( claimable_outpoints, ( commitment_txid, watch_outputs) ) ,
16331623 Some ( their_htlc_base_key) => ignore_error ! ( chan_utils:: derive_public_key( & self . secp_ctx, revocation_point, & their_htlc_base_key) ) ,
16341624 } ;
1635- let local_payment_key = ignore_error ! ( chan_utils:: derive_private_key( & self . secp_ctx, revocation_point, & self . onchain_detection . keys. payment_base_key( ) ) ) ;
1625+ let local_payment_key = ignore_error ! ( chan_utils:: derive_private_key( & self . secp_ctx, revocation_point, & self . keys. payment_base_key( ) ) ) ;
16361626
16371627 self . broadcasted_remote_payment_script = {
16381628 // Note that the Network here is ignored as we immediately drop the address for the
@@ -1683,8 +1673,8 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
16831673 let secret = if let Some ( secret) = self . get_secret ( commitment_number) { secret } else { return ( Vec :: new ( ) , None ) ; } ;
16841674 let per_commitment_key = ignore_error ! ( SecretKey :: from_slice( & secret) ) ;
16851675 let per_commitment_point = PublicKey :: from_secret_key ( & self . secp_ctx , & per_commitment_key) ;
1686- let revocation_pubkey = ignore_error ! ( chan_utils:: derive_public_revocation_key( & self . secp_ctx, & per_commitment_point, & self . onchain_detection . keys. pubkeys( ) . revocation_basepoint) ) ;
1687- let revocation_key = ignore_error ! ( chan_utils:: derive_private_revocation_key( & self . secp_ctx, & per_commitment_key, & self . onchain_detection . keys. revocation_base_key( ) ) ) ;
1676+ let revocation_pubkey = ignore_error ! ( chan_utils:: derive_public_revocation_key( & self . secp_ctx, & per_commitment_point, & self . keys. pubkeys( ) . revocation_basepoint) ) ;
1677+ let revocation_key = ignore_error ! ( chan_utils:: derive_private_revocation_key( & self . secp_ctx, & per_commitment_key, & self . keys. revocation_base_key( ) ) ) ;
16881678 let delayed_key = match self . their_delayed_payment_base_key {
16891679 None => return ( Vec :: new ( ) , None ) ,
16901680 Some ( their_delayed_payment_base_key) => ignore_error ! ( chan_utils:: derive_public_key( & self . secp_ctx, & per_commitment_point, & their_delayed_payment_base_key) ) ,
@@ -1702,7 +1692,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
17021692 let mut watch_outputs = Vec :: with_capacity ( local_tx. htlc_outputs . len ( ) ) ;
17031693
17041694 let redeemscript = chan_utils:: get_revokeable_redeemscript ( & local_tx. revocation_key , self . their_to_self_delay . unwrap ( ) , & local_tx. delayed_payment_key ) ;
1705- let broadcasted_local_revokable_script = if let Ok ( local_delayedkey) = chan_utils:: derive_private_key ( & self . secp_ctx , & local_tx. per_commitment_point , self . onchain_detection . keys . delayed_payment_base_key ( ) ) {
1695+ let broadcasted_local_revokable_script = if let Ok ( local_delayedkey) = chan_utils:: derive_private_key ( & self . secp_ctx , & local_tx. per_commitment_point , self . keys . delayed_payment_base_key ( ) ) {
17061696 Some ( ( redeemscript. to_v0_p2wsh ( ) , local_delayedkey, redeemscript) )
17071697 } else { None } ;
17081698
@@ -1883,7 +1873,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
18831873 // which is an easy way to filter out any potential non-matching txn for lazy
18841874 // filters.
18851875 let prevout = & tx. input [ 0 ] . previous_output ;
1886- let funding_txo = self . onchain_detection . funding_info . clone ( ) ;
1876+ let funding_txo = self . funding_info . clone ( ) ;
18871877 if funding_txo. is_none ( ) || ( prevout. txid == funding_txo. as_ref ( ) . unwrap ( ) . 0 . txid && prevout. vout == funding_txo. as_ref ( ) . unwrap ( ) . 0 . index as u32 ) {
18881878 if ( tx. input [ 0 ] . sequence >> 8 * 3 ) as u8 == 0x80 && ( tx. lock_time >> 8 * 3 ) as u8 == 0x20 {
18891879 let ( mut new_outpoints, new_outputs) = self . check_spend_remote_transaction ( & tx, height) ;
@@ -1920,7 +1910,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
19201910 self . would_broadcast_at_height ( height)
19211911 } else { false } ;
19221912 if should_broadcast {
1923- claimable_outpoints. push ( ClaimRequest { absolute_timelock : height, aggregable : false , outpoint : BitcoinOutPoint { txid : self . onchain_detection . funding_info . as_ref ( ) . unwrap ( ) . 0 . txid . clone ( ) , vout : self . onchain_detection . funding_info . as_ref ( ) . unwrap ( ) . 0 . index as u32 } , witness_data : InputMaterial :: Funding { channel_value : self . channel_value_satoshis . unwrap ( ) } } ) ;
1913+ claimable_outpoints. push ( ClaimRequest { absolute_timelock : height, aggregable : false , outpoint : BitcoinOutPoint { txid : self . funding_info . as_ref ( ) . unwrap ( ) . 0 . txid . clone ( ) , vout : self . funding_info . as_ref ( ) . unwrap ( ) . 0 . index as u32 } , witness_data : InputMaterial :: Funding { channel_value : self . channel_value_satoshis . unwrap ( ) } } ) ;
19241914 }
19251915 if let Some ( ref cur_local_tx) = self . current_local_signed_commitment_tx {
19261916 if should_broadcast {
@@ -2030,12 +2020,12 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
20302020 scan_commitment ! ( cur_local_tx. htlc_outputs. iter( ) . map( |& ( ref a, _, _) | a) , true ) ;
20312021 }
20322022
2033- if let Some ( ref txid) = self . onchain_detection . current_remote_commitment_txid {
2023+ if let Some ( ref txid) = self . current_remote_commitment_txid {
20342024 if let Some ( ref htlc_outputs) = self . remote_claimable_outpoints . get ( txid) {
20352025 scan_commitment ! ( htlc_outputs. iter( ) . map( |& ( ref a, _) | a) , false ) ;
20362026 }
20372027 }
2038- if let Some ( ref txid) = self . onchain_detection . prev_remote_commitment_txid {
2028+ if let Some ( ref txid) = self . prev_remote_commitment_txid {
20392029 if let Some ( ref htlc_outputs) = self . remote_claimable_outpoints . get ( txid) {
20402030 scan_commitment ! ( htlc_outputs. iter( ) . map( |& ( ref a, _) | a) , false ) ;
20412031 }
@@ -2105,9 +2095,9 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
21052095 // resolve the source HTLC with the original sender.
21062096 payment_data = Some ( ( ( * source) . clone( ) , htlc_output. payment_hash) ) ;
21072097 } else if !$local_tx {
2108- check_htlc_valid_remote!( self . onchain_detection . current_remote_commitment_txid, htlc_output) ;
2098+ check_htlc_valid_remote!( self . current_remote_commitment_txid, htlc_output) ;
21092099 if payment_data. is_none( ) {
2110- check_htlc_valid_remote!( self . onchain_detection . prev_remote_commitment_txid, htlc_output) ;
2100+ check_htlc_valid_remote!( self . prev_remote_commitment_txid, htlc_output) ;
21112101 }
21122102 }
21132103 if payment_data. is_none( ) {
@@ -2278,24 +2268,16 @@ impl<ChanSigner: ChannelKeys + Readable> ReadableArgs<Arc<Logger>> for (Sha256dH
22782268 } ;
22792269 let shutdown_script = Readable :: read ( reader) ?;
22802270
2281- let onchain_detection = {
2282- let keys = Readable :: read ( reader) ?;
2283- // Technically this can fail and serialize fail a round-trip, but only for serialization of
2284- // barely-init'd ChannelMonitors that we can't do anything with.
2285- let outpoint = OutPoint {
2286- txid : Readable :: read ( reader) ?,
2287- index : Readable :: read ( reader) ?,
2288- } ;
2289- let funding_info = Some ( ( outpoint, Readable :: read ( reader) ?) ) ;
2290- let current_remote_commitment_txid = Readable :: read ( reader) ?;
2291- let prev_remote_commitment_txid = Readable :: read ( reader) ?;
2292- OnchainDetection {
2293- keys,
2294- funding_info,
2295- current_remote_commitment_txid,
2296- prev_remote_commitment_txid,
2297- }
2271+ let keys = Readable :: read ( reader) ?;
2272+ // Technically this can fail and serialize fail a round-trip, but only for serialization of
2273+ // barely-init'd ChannelMonitors that we can't do anything with.
2274+ let outpoint = OutPoint {
2275+ txid : Readable :: read ( reader) ?,
2276+ index : Readable :: read ( reader) ?,
22982277 } ;
2278+ let funding_info = Some ( ( outpoint, Readable :: read ( reader) ?) ) ;
2279+ let current_remote_commitment_txid = Readable :: read ( reader) ?;
2280+ let prev_remote_commitment_txid = Readable :: read ( reader) ?;
22992281
23002282 let their_htlc_base_key = Some ( Readable :: read ( reader) ?) ;
23012283 let their_delayed_payment_base_key = Some ( Readable :: read ( reader) ?) ;
@@ -2508,7 +2490,11 @@ impl<ChanSigner: ChannelKeys + Readable> ReadableArgs<Arc<Logger>> for (Sha256dH
25082490 broadcasted_remote_payment_script,
25092491 shutdown_script,
25102492
2511- onchain_detection,
2493+ keys,
2494+ funding_info,
2495+ current_remote_commitment_txid,
2496+ prev_remote_commitment_txid,
2497+
25122498 their_htlc_base_key,
25132499 their_delayed_payment_base_key,
25142500 funding_redeemscript,
0 commit comments