@@ -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
@@ -941,12 +941,12 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
941
941
942
942
#[ inline]
943
943
fn finish_force_close_channel ( & self , shutdown_res : ShutdownResult ) {
944
- let ( funding_txo_option , monitor_update , mut failed_htlcs) = shutdown_res;
944
+ let ( monitor_update_option , mut failed_htlcs) = shutdown_res;
945
945
log_trace ! ( self . logger, "Finishing force-closure of channel {} HTLCs to fail" , failed_htlcs. len( ) ) ;
946
946
for htlc_source in failed_htlcs. drain ( ..) {
947
947
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 ( ) } ) ;
948
948
}
949
- if let Some ( funding_txo) = funding_txo_option {
949
+ if let Some ( ( funding_txo, monitor_update ) ) = monitor_update_option {
950
950
// There isn't anything we can do if we get an update failure - we're already
951
951
// force-closing. The monitor update on the required in-memory copy should broadcast
952
952
// the latest local state, which is the best we can do anyway. Thus, it is safe to
@@ -2417,7 +2417,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
2417
2417
// We do not do a force-close here as that would generate a monitor update for
2418
2418
// a monitor that we didn't manage to store (and that we don't care about - we
2419
2419
// don't respond with the funding_signed so the channel can never go on chain).
2420
- let ( _funding_txo_option , _monitor_update, failed_htlcs) = chan. force_shutdown ( true ) ;
2420
+ let ( _monitor_update, failed_htlcs) = chan. force_shutdown ( true ) ;
2421
2421
assert ! ( failed_htlcs. is_empty( ) ) ;
2422
2422
return Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "ChannelMonitor storage failure" . to_owned ( ) , funding_msg. channel_id ) ) ;
2423
2423
} ,
@@ -4070,7 +4070,7 @@ impl<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
4070
4070
channel. get_cur_counterparty_commitment_transaction_number ( ) > monitor. get_cur_counterparty_commitment_number ( ) ||
4071
4071
channel. get_latest_monitor_update_id ( ) < monitor. get_latest_update_id ( ) {
4072
4072
// But if the channel is behind of the monitor, close the channel:
4073
- let ( _, _ , mut new_failed_htlcs) = channel. force_shutdown ( true ) ;
4073
+ let ( _, mut new_failed_htlcs) = channel. force_shutdown ( true ) ;
4074
4074
failed_htlcs. append ( & mut new_failed_htlcs) ;
4075
4075
monitor. broadcast_latest_holder_commitment_txn ( & args. tx_broadcaster , & args. logger ) ;
4076
4076
} else {
0 commit comments