@@ -1015,7 +1015,7 @@ enum UpdateFulfillFetch {
1015
1015
NewClaim {
1016
1016
monitor_update: ChannelMonitorUpdate,
1017
1017
htlc_value_msat: u64,
1018
- msg: Option<msgs::UpdateFulfillHTLC> ,
1018
+ update_non_blocked: bool ,
1019
1019
},
1020
1020
DuplicateClaim {},
1021
1021
}
@@ -5349,8 +5349,8 @@ impl<SP: Deref> FundedChannel<SP> where
5349
5349
let mon_update_id = self.context.latest_monitor_update_id; // Forget the ChannelMonitor update
5350
5350
let fulfill_resp = self.get_update_fulfill_htlc(htlc_id_arg, payment_preimage_arg, None, logger);
5351
5351
self.context.latest_monitor_update_id = mon_update_id;
5352
- if let UpdateFulfillFetch::NewClaim { msg , .. } = fulfill_resp {
5353
- assert!(msg.is_none() ); // The HTLC must have ended up in the holding cell.
5352
+ if let UpdateFulfillFetch::NewClaim { update_non_blocked , .. } = fulfill_resp {
5353
+ assert!(!update_non_blocked ); // The HTLC must have ended up in the holding cell.
5354
5354
}
5355
5355
}
5356
5356
@@ -5437,7 +5437,7 @@ impl<SP: Deref> FundedChannel<SP> where
5437
5437
// TODO: We may actually be able to switch to a fulfill here, though its
5438
5438
// rare enough it may not be worth the complexity burden.
5439
5439
debug_assert!(false, "Tried to fulfill an HTLC that was already failed");
5440
- return UpdateFulfillFetch::NewClaim { monitor_update, htlc_value_msat, msg: None };
5440
+ return UpdateFulfillFetch::NewClaim { monitor_update, htlc_value_msat, update_non_blocked: false };
5441
5441
}
5442
5442
},
5443
5443
_ => {}
@@ -5447,15 +5447,15 @@ impl<SP: Deref> FundedChannel<SP> where
5447
5447
self.context.holding_cell_htlc_updates.push(HTLCUpdateAwaitingACK::ClaimHTLC {
5448
5448
payment_preimage: payment_preimage_arg, htlc_id: htlc_id_arg,
5449
5449
});
5450
- return UpdateFulfillFetch::NewClaim { monitor_update, htlc_value_msat, msg: None };
5450
+ return UpdateFulfillFetch::NewClaim { monitor_update, htlc_value_msat, update_non_blocked: false };
5451
5451
}
5452
5452
5453
5453
{
5454
5454
let htlc = &mut self.context.pending_inbound_htlcs[pending_idx];
5455
5455
if let InboundHTLCState::Committed = htlc.state {
5456
5456
} else {
5457
5457
debug_assert!(false, "Have an inbound HTLC we tried to claim before it was fully committed to");
5458
- return UpdateFulfillFetch::NewClaim { monitor_update, htlc_value_msat, msg: None };
5458
+ return UpdateFulfillFetch::NewClaim { monitor_update, htlc_value_msat, update_non_blocked: false };
5459
5459
}
5460
5460
log_trace!(logger, "Upgrading HTLC {} to LocalRemoved with a Fulfill in channel {}!", &htlc.payment_hash, &self.context.channel_id);
5461
5461
htlc.state = InboundHTLCState::LocalRemoved(InboundHTLCRemovalReason::Fulfill(payment_preimage_arg.clone()));
@@ -5464,11 +5464,7 @@ impl<SP: Deref> FundedChannel<SP> where
5464
5464
UpdateFulfillFetch::NewClaim {
5465
5465
monitor_update,
5466
5466
htlc_value_msat,
5467
- msg: Some(msgs::UpdateFulfillHTLC {
5468
- channel_id: self.context.channel_id(),
5469
- htlc_id: htlc_id_arg,
5470
- payment_preimage: payment_preimage_arg,
5471
- }),
5467
+ update_non_blocked: true,
5472
5468
}
5473
5469
}
5474
5470
@@ -5478,13 +5474,13 @@ impl<SP: Deref> FundedChannel<SP> where
5478
5474
) -> UpdateFulfillCommitFetch where L::Target: Logger {
5479
5475
let release_cs_monitor = self.context.blocked_monitor_updates.is_empty();
5480
5476
match self.get_update_fulfill_htlc(htlc_id, payment_preimage, payment_info, logger) {
5481
- UpdateFulfillFetch::NewClaim { mut monitor_update, htlc_value_msat, msg } => {
5477
+ UpdateFulfillFetch::NewClaim { mut monitor_update, htlc_value_msat, update_non_blocked } => {
5482
5478
// Even if we aren't supposed to let new monitor updates with commitment state
5483
5479
// updates run, we still need to push the preimage ChannelMonitorUpdateStep no
5484
5480
// matter what. Sadly, to push a new monitor update which flies before others
5485
5481
// already queued, we have to insert it into the pending queue and update the
5486
5482
// update_ids of all the following monitors.
5487
- if release_cs_monitor && msg.is_some() {
5483
+ if release_cs_monitor && update_non_blocked {
5488
5484
let mut additional_update = self.build_commitment_no_status_check(logger);
5489
5485
// build_commitment_no_status_check may bump latest_monitor_id but we want them
5490
5486
// to be strictly increasing by one, so decrement it here.
@@ -5497,7 +5493,7 @@ impl<SP: Deref> FundedChannel<SP> where
5497
5493
for held_update in self.context.blocked_monitor_updates.iter_mut() {
5498
5494
held_update.update.update_id += 1;
5499
5495
}
5500
- if msg.is_some() {
5496
+ if update_non_blocked {
5501
5497
debug_assert!(false, "If there is a pending blocked monitor we should have MonitorUpdateInProgress set");
5502
5498
let update = self.build_commitment_no_status_check(logger);
5503
5499
self.context.blocked_monitor_updates.push(PendingChannelMonitorUpdate {
@@ -5506,7 +5502,7 @@ impl<SP: Deref> FundedChannel<SP> where
5506
5502
}
5507
5503
}
5508
5504
5509
- self.monitor_updating_paused(false, msg.is_some() , false, Vec::new(), Vec::new(), Vec::new());
5505
+ self.monitor_updating_paused(false, msg, false, Vec::new(), Vec::new(), Vec::new());
5510
5506
UpdateFulfillCommitFetch::NewClaim { monitor_update, htlc_value_msat, }
5511
5507
},
5512
5508
UpdateFulfillFetch::DuplicateClaim {} => UpdateFulfillCommitFetch::DuplicateClaim {},
0 commit comments