Skip to content

Commit 88485d2

Browse files
committed
Consume vectors in monitor_updating_paused
Using extend is slightly cleaner because it doesn't require mut on the parameters.
1 parent cafbd56 commit 88485d2

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

lightning/src/ln/channel.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9392,10 +9392,9 @@ where
93929392
/// [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
93939393
fn monitor_updating_paused<L: Deref>(
93949394
&mut self, resend_raa: bool, resend_commitment: bool, resend_channel_ready: bool,
9395-
mut pending_forwards: Vec<(PendingHTLCInfo, u64)>,
9396-
mut pending_fails: Vec<(HTLCSource, PaymentHash, HTLCFailReason)>,
9397-
mut pending_finalized_claimed_htlcs: Vec<(HTLCSource, Option<AttributionData>)>,
9398-
logger: &L,
9395+
pending_forwards: Vec<(PendingHTLCInfo, u64)>,
9396+
pending_fails: Vec<(HTLCSource, PaymentHash, HTLCFailReason)>,
9397+
pending_finalized_claimed_htlcs: Vec<(HTLCSource, Option<AttributionData>)>, logger: &L,
93999398
) where
94009399
L::Target: Logger,
94019400
{
@@ -9404,11 +9403,9 @@ where
94049403
self.context.monitor_pending_revoke_and_ack |= resend_raa;
94059404
self.context.monitor_pending_commitment_signed |= resend_commitment;
94069405
self.context.monitor_pending_channel_ready |= resend_channel_ready;
9407-
self.context.monitor_pending_forwards.append(&mut pending_forwards);
9408-
self.context.monitor_pending_failures.append(&mut pending_fails);
9409-
self.context
9410-
.monitor_pending_finalized_fulfills
9411-
.append(&mut pending_finalized_claimed_htlcs);
9406+
self.context.monitor_pending_forwards.extend(pending_forwards);
9407+
self.context.monitor_pending_failures.extend(pending_fails);
9408+
self.context.monitor_pending_finalized_fulfills.extend(pending_finalized_claimed_htlcs);
94129409
self.context.channel_state.set_monitor_update_in_progress();
94139410
}
94149411

0 commit comments

Comments
 (0)