@@ -1458,9 +1458,6 @@ macro_rules! remove_channel {
1458
1458
}
1459
1459
1460
1460
macro_rules! handle_monitor_err {
1461
- ( $self: ident, $err: expr, $channel_state: expr, $entry: expr, $action_type: path, $resend_raa: expr, $resend_commitment: expr) => {
1462
- handle_monitor_err!( $self, $err, $channel_state, $entry, $action_type, $resend_raa, $resend_commitment, Vec :: new( ) , Vec :: new( ) )
1463
- } ;
1464
1461
( $self: ident, $err: expr, $short_to_id: expr, $chan: expr, $action_type: path, $resend_raa: expr, $resend_commitment: expr, $failed_forwards: expr, $failed_fails: expr, $failed_finalized_fulfills: expr, $chan_id: expr) => {
1465
1462
match $err {
1466
1463
ChannelMonitorUpdateErr :: PermanentFailure => {
@@ -1513,9 +1510,19 @@ macro_rules! handle_monitor_err {
1513
1510
}
1514
1511
res
1515
1512
} } ;
1513
+ ( $self: ident, $err: expr, $channel_state: expr, $entry: expr, $action_type: path, $chan_id: expr, COMMITMENT_UPDATE_ONLY ) => { {
1514
+ debug_assert!( $action_type == RAACommitmentOrder :: CommitmentFirst ) ;
1515
+ handle_monitor_err!( $self, $err, $channel_state, $entry, $action_type, false , true , Vec :: new( ) , Vec :: new( ) , Vec :: new( ) , $chan_id)
1516
+ } } ;
1517
+ ( $self: ident, $err: expr, $channel_state: expr, $entry: expr, $action_type: path, $chan_id: expr, NO_UPDATE ) => {
1518
+ handle_monitor_err!( $self, $err, $channel_state, $entry, $action_type, false , false , Vec :: new( ) , Vec :: new( ) , Vec :: new( ) , $chan_id)
1519
+ } ;
1520
+ ( $self: ident, $err: expr, $channel_state: expr, $entry: expr, $action_type: path, $resend_raa: expr, $resend_commitment: expr) => {
1521
+ handle_monitor_err!( $self, $err, $channel_state, $entry, $action_type, $resend_raa, $resend_commitment, Vec :: new( ) , Vec :: new( ) , Vec :: new( ) )
1522
+ } ;
1516
1523
( $self: ident, $err: expr, $channel_state: expr, $entry: expr, $action_type: path, $resend_raa: expr, $resend_commitment: expr, $failed_forwards: expr, $failed_fails: expr) => {
1517
1524
handle_monitor_err!( $self, $err, $channel_state, $entry, $action_type, $resend_raa, $resend_commitment, $failed_forwards, $failed_fails, Vec :: new( ) )
1518
- }
1525
+ } ;
1519
1526
}
1520
1527
1521
1528
macro_rules! return_monitor_err {
@@ -1911,7 +1918,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
1911
1918
if let Some ( monitor_update) = monitor_update {
1912
1919
if let Err ( e) = self . chain_monitor . update_channel ( chan_entry. get ( ) . get_funding_txo ( ) . unwrap ( ) , monitor_update) {
1913
1920
let ( result, is_permanent) =
1914
- handle_monitor_err ! ( self , e, channel_state. short_to_id, chan_entry. get_mut( ) , RAACommitmentOrder :: CommitmentFirst , false , false , Vec :: new ( ) , Vec :: new ( ) , Vec :: new ( ) , chan_entry. key( ) ) ;
1921
+ handle_monitor_err ! ( self , e, channel_state. short_to_id, chan_entry. get_mut( ) , RAACommitmentOrder :: CommitmentFirst , chan_entry. key( ) , NO_UPDATE ) ;
1915
1922
if is_permanent {
1916
1923
remove_channel ! ( channel_state, chan_entry) ;
1917
1924
break result;
@@ -3455,7 +3462,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
3455
3462
let ret_err = match res {
3456
3463
Ok ( Some ( ( update_fee, commitment_signed, monitor_update) ) ) => {
3457
3464
if let Err ( e) = self . chain_monitor . update_channel ( chan. get_funding_txo ( ) . unwrap ( ) , monitor_update) {
3458
- let ( res, drop) = handle_monitor_err ! ( self , e, short_to_id, chan, RAACommitmentOrder :: CommitmentFirst , false , true , Vec :: new ( ) , Vec :: new ( ) , Vec :: new ( ) , chan_id ) ;
3465
+ let ( res, drop) = handle_monitor_err ! ( self , e, short_to_id, chan, RAACommitmentOrder :: CommitmentFirst , chan_id , COMMITMENT_UPDATE_ONLY ) ;
3459
3466
if drop { retain_channel = false ; }
3460
3467
res
3461
3468
} else {
@@ -4399,7 +4406,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
4399
4406
if let Some ( monitor_update) = monitor_update {
4400
4407
if let Err ( e) = self . chain_monitor . update_channel ( chan_entry. get ( ) . get_funding_txo ( ) . unwrap ( ) , monitor_update) {
4401
4408
let ( result, is_permanent) =
4402
- handle_monitor_err ! ( self , e, channel_state. short_to_id, chan_entry. get_mut( ) , RAACommitmentOrder :: CommitmentFirst , false , false , Vec :: new ( ) , Vec :: new ( ) , Vec :: new ( ) , chan_entry. key( ) ) ;
4409
+ handle_monitor_err ! ( self , e, channel_state. short_to_id, chan_entry. get_mut( ) , RAACommitmentOrder :: CommitmentFirst , chan_entry. key( ) , NO_UPDATE ) ;
4403
4410
if is_permanent {
4404
4411
remove_channel ! ( channel_state, chan_entry) ;
4405
4412
break result;
@@ -4965,7 +4972,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
4965
4972
if let Some ( ( commitment_update, monitor_update) ) = commitment_opt {
4966
4973
if let Err ( e) = self . chain_monitor . update_channel ( chan. get_funding_txo ( ) . unwrap ( ) , monitor_update) {
4967
4974
has_monitor_update = true ;
4968
- let ( res, close_channel) = handle_monitor_err ! ( self , e, short_to_id, chan, RAACommitmentOrder :: CommitmentFirst , false , true , Vec :: new ( ) , Vec :: new ( ) , Vec :: new ( ) , channel_id ) ;
4975
+ let ( res, close_channel) = handle_monitor_err ! ( self , e, short_to_id, chan, RAACommitmentOrder :: CommitmentFirst , channel_id , COMMITMENT_UPDATE_ONLY ) ;
4969
4976
handle_errors. push ( ( chan. get_counterparty_node_id ( ) , res) ) ;
4970
4977
if close_channel { return false ; }
4971
4978
} else {
0 commit comments