@@ -206,7 +206,7 @@ pub struct PaymentPreimage(pub [u8;32]);
206
206
#[ derive( Hash , Copy , Clone , PartialEq , Eq , Debug ) ]
207
207
pub struct PaymentSecret ( pub [ u8 ; 32 ] ) ;
208
208
209
- type ShutdownResult = ( Option < OutPoint > , ChannelMonitorUpdate , Vec < ( HTLCSource , PaymentHash ) > ) ;
209
+ type ShutdownResult = ( Option < ( OutPoint , ChannelMonitorUpdate ) > , Vec < ( HTLCSource , PaymentHash ) > ) ;
210
210
211
211
/// Error type returned across the channel_state mutex boundary. When an Err is generated for a
212
212
/// Channel, we generally end up with a ChannelError::Close for which we have to close the channel
@@ -942,12 +942,12 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
942
942
943
943
#[ inline]
944
944
fn finish_force_close_channel ( & self , shutdown_res : ShutdownResult ) {
945
- let ( funding_txo_option , monitor_update , mut failed_htlcs) = shutdown_res;
945
+ let ( monitor_update_option , mut failed_htlcs) = shutdown_res;
946
946
log_trace ! ( self . logger, "Finishing force-closure of channel {} HTLCs to fail" , failed_htlcs. len( ) ) ;
947
947
for htlc_source in failed_htlcs. drain ( ..) {
948
948
self . fail_htlc_backwards_internal ( self . channel_state . lock ( ) . unwrap ( ) , htlc_source. 0 , & htlc_source. 1 , HTLCFailReason :: Reason { failure_code : 0x4000 | 8 , data : Vec :: new ( ) } ) ;
949
949
}
950
- if let Some ( funding_txo) = funding_txo_option {
950
+ if let Some ( ( funding_txo, monitor_update ) ) = monitor_update_option {
951
951
// There isn't anything we can do if we get an update failure - we're already
952
952
// force-closing. The monitor update on the required in-memory copy should broadcast
953
953
// the latest local state, which is the best we can do anyway. Thus, it is safe to
@@ -2418,7 +2418,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
2418
2418
// We do not do a force-close here as that would generate a monitor update for
2419
2419
// a monitor that we didn't manage to store (and that we don't care about - we
2420
2420
// don't respond with the funding_signed so the channel can never go on chain).
2421
- let ( _funding_txo_option , _monitor_update, failed_htlcs) = chan. force_shutdown ( true ) ;
2421
+ let ( _monitor_update, failed_htlcs) = chan. force_shutdown ( true ) ;
2422
2422
assert ! ( failed_htlcs. is_empty( ) ) ;
2423
2423
return Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "ChannelMonitor storage failure" . to_owned ( ) , funding_msg. channel_id ) ) ;
2424
2424
} ,
@@ -4071,7 +4071,7 @@ impl<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
4071
4071
channel. get_cur_counterparty_commitment_transaction_number ( ) > monitor. get_cur_counterparty_commitment_number ( ) ||
4072
4072
channel. get_latest_monitor_update_id ( ) < monitor. get_latest_update_id ( ) {
4073
4073
// But if the channel is behind of the monitor, close the channel:
4074
- let ( _, _ , mut new_failed_htlcs) = channel. force_shutdown ( true ) ;
4074
+ let ( _, mut new_failed_htlcs) = channel. force_shutdown ( true ) ;
4075
4075
failed_htlcs. append ( & mut new_failed_htlcs) ;
4076
4076
monitor. broadcast_latest_holder_commitment_txn ( & args. tx_broadcaster , & args. logger ) ;
4077
4077
} else {
0 commit comments