@@ -1709,7 +1709,7 @@ where
1709
1709
1710
1710
// Update the monitor with the shutdown script if necessary.
1711
1711
if let Some ( monitor_update) = monitor_update {
1712
- let update_res = self . chain_monitor . update_channel ( chan_entry. get ( ) . get_funding_txo ( ) . unwrap ( ) , monitor_update) ;
1712
+ let update_res = self . chain_monitor . update_channel ( chan_entry. get ( ) . get_funding_txo ( ) . unwrap ( ) , & monitor_update) ;
1713
1713
let ( result, is_permanent) =
1714
1714
handle_monitor_update_res ! ( self , update_res, chan_entry. get_mut( ) , RAACommitmentOrder :: CommitmentFirst , chan_entry. key( ) , NO_UPDATE ) ;
1715
1715
if is_permanent {
@@ -1807,7 +1807,7 @@ where
1807
1807
// force-closing. The monitor update on the required in-memory copy should broadcast
1808
1808
// the latest local state, which is the best we can do anyway. Thus, it is safe to
1809
1809
// ignore the result here.
1810
- let _ = self . chain_monitor . update_channel ( funding_txo, monitor_update) ;
1810
+ let _ = self . chain_monitor . update_channel ( funding_txo, & monitor_update) ;
1811
1811
}
1812
1812
}
1813
1813
@@ -2336,7 +2336,7 @@ where
2336
2336
chan)
2337
2337
} {
2338
2338
Some ( ( update_add, commitment_signed, monitor_update) ) => {
2339
- let update_err = self . chain_monitor . update_channel ( chan. get ( ) . get_funding_txo ( ) . unwrap ( ) , monitor_update) ;
2339
+ let update_err = self . chain_monitor . update_channel ( chan. get ( ) . get_funding_txo ( ) . unwrap ( ) , & monitor_update) ;
2340
2340
let chan_id = chan. get ( ) . channel_id ( ) ;
2341
2341
match ( update_err,
2342
2342
handle_monitor_update_res ! ( self , update_err, chan,
@@ -3284,7 +3284,7 @@ where
3284
3284
BackgroundEvent :: ClosingMonitorUpdate ( ( funding_txo, update) ) => {
3285
3285
// The channel has already been closed, so no use bothering to care about the
3286
3286
// monitor updating completing.
3287
- let _ = self . chain_monitor . update_channel ( funding_txo, update) ;
3287
+ let _ = self . chain_monitor . update_channel ( funding_txo, & update) ;
3288
3288
} ,
3289
3289
}
3290
3290
}
@@ -3807,7 +3807,7 @@ where
3807
3807
match chan. get_mut ( ) . get_update_fulfill_htlc_and_commit ( prev_hop. htlc_id , payment_preimage, & self . logger ) {
3808
3808
Ok ( msgs_monitor_option) => {
3809
3809
if let UpdateFulfillCommitFetch :: NewClaim { msgs, htlc_value_msat, monitor_update } = msgs_monitor_option {
3810
- match self . chain_monitor . update_channel ( chan. get ( ) . get_funding_txo ( ) . unwrap ( ) , monitor_update) {
3810
+ match self . chain_monitor . update_channel ( chan. get ( ) . get_funding_txo ( ) . unwrap ( ) , & monitor_update) {
3811
3811
ChannelMonitorUpdateStatus :: Completed => { } ,
3812
3812
e => {
3813
3813
log_given_level ! ( self . logger, if e == ChannelMonitorUpdateStatus :: PermanentFailure { Level :: Error } else { Level :: Debug } ,
@@ -3844,7 +3844,7 @@ where
3844
3844
}
3845
3845
} ,
3846
3846
Err ( ( e, monitor_update) ) => {
3847
- match self . chain_monitor . update_channel ( chan. get ( ) . get_funding_txo ( ) . unwrap ( ) , monitor_update) {
3847
+ match self . chain_monitor . update_channel ( chan. get ( ) . get_funding_txo ( ) . unwrap ( ) , & monitor_update) {
3848
3848
ChannelMonitorUpdateStatus :: Completed => { } ,
3849
3849
e => {
3850
3850
// TODO: This needs to be handled somehow - if we receive a monitor update
@@ -3880,7 +3880,7 @@ where
3880
3880
} ;
3881
3881
// We update the ChannelMonitor on the backward link, after
3882
3882
// receiving an `update_fulfill_htlc` from the forward link.
3883
- let update_res = self . chain_monitor . update_channel ( prev_hop. outpoint , preimage_update) ;
3883
+ let update_res = self . chain_monitor . update_channel ( prev_hop. outpoint , & preimage_update) ;
3884
3884
if update_res != ChannelMonitorUpdateStatus :: Completed {
3885
3885
// TODO: This needs to be handled somehow - if we receive a monitor update
3886
3886
// with a preimage we *must* somehow manage to propagate it to the upstream
@@ -4449,7 +4449,7 @@ where
4449
4449
4450
4450
// Update the monitor with the shutdown script if necessary.
4451
4451
if let Some ( monitor_update) = monitor_update {
4452
- let update_res = self . chain_monitor . update_channel ( chan_entry. get ( ) . get_funding_txo ( ) . unwrap ( ) , monitor_update) ;
4452
+ let update_res = self . chain_monitor . update_channel ( chan_entry. get ( ) . get_funding_txo ( ) . unwrap ( ) , & monitor_update) ;
4453
4453
let ( result, is_permanent) =
4454
4454
handle_monitor_update_res ! ( self , update_res, chan_entry. get_mut( ) , RAACommitmentOrder :: CommitmentFirst , chan_entry. key( ) , NO_UPDATE ) ;
4455
4455
if is_permanent {
@@ -4650,13 +4650,13 @@ where
4650
4650
Err ( ( None , e) ) => try_chan_entry ! ( self , Err ( e) , chan) ,
4651
4651
Err ( ( Some ( update) , e) ) => {
4652
4652
assert ! ( chan. get( ) . is_awaiting_monitor_update( ) ) ;
4653
- let _ = self . chain_monitor . update_channel ( chan. get ( ) . get_funding_txo ( ) . unwrap ( ) , update) ;
4653
+ let _ = self . chain_monitor . update_channel ( chan. get ( ) . get_funding_txo ( ) . unwrap ( ) , & update) ;
4654
4654
try_chan_entry ! ( self , Err ( e) , chan) ;
4655
4655
unreachable ! ( ) ;
4656
4656
} ,
4657
4657
Ok ( res) => res
4658
4658
} ;
4659
- let update_res = self . chain_monitor . update_channel ( chan. get ( ) . get_funding_txo ( ) . unwrap ( ) , monitor_update) ;
4659
+ let update_res = self . chain_monitor . update_channel ( chan. get ( ) . get_funding_txo ( ) . unwrap ( ) , & monitor_update) ;
4660
4660
if let Err ( e) = handle_monitor_update_res ! ( self , update_res, chan, RAACommitmentOrder :: RevokeAndACKFirst , true , commitment_signed. is_some( ) ) {
4661
4661
return Err ( e) ;
4662
4662
}
@@ -4792,7 +4792,7 @@ where
4792
4792
let raa_updates = break_chan_entry ! ( self ,
4793
4793
chan. get_mut( ) . revoke_and_ack( & msg, & self . logger) , chan) ;
4794
4794
htlcs_to_fail = raa_updates. holding_cell_failed_htlcs ;
4795
- let update_res = self . chain_monitor . update_channel ( chan. get ( ) . get_funding_txo ( ) . unwrap ( ) , raa_updates. monitor_update ) ;
4795
+ let update_res = self . chain_monitor . update_channel ( chan. get ( ) . get_funding_txo ( ) . unwrap ( ) , & raa_updates. monitor_update ) ;
4796
4796
if was_paused_for_mon_update {
4797
4797
assert ! ( update_res != ChannelMonitorUpdateStatus :: Completed ) ;
4798
4798
assert ! ( raa_updates. commitment_update. is_none( ) ) ;
@@ -5097,7 +5097,7 @@ where
5097
5097
) ) ;
5098
5098
}
5099
5099
if let Some ( ( commitment_update, monitor_update) ) = commitment_opt {
5100
- match self . chain_monitor . update_channel ( chan. get_funding_txo ( ) . unwrap ( ) , monitor_update) {
5100
+ match self . chain_monitor . update_channel ( chan. get_funding_txo ( ) . unwrap ( ) , & monitor_update) {
5101
5101
ChannelMonitorUpdateStatus :: Completed => {
5102
5102
pending_msg_events. push ( events:: MessageSendEvent :: UpdateHTLCs {
5103
5103
node_id : chan. get_counterparty_node_id ( ) ,
0 commit comments