Skip to content

Commit 30a6678

Browse files
committed
f re-add unused
1 parent 35c4336 commit 30a6678

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

lightning/src/ln/channelmanager.rs

+18-1
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,6 @@ pub(crate) enum RAAMonitorUpdateBlockingAction {
589589
}
590590

591591
impl RAAMonitorUpdateBlockingAction {
592-
#[allow(unused)]
593592
fn from_prev_hop_data(prev_hop: &HTLCPreviousHopData) -> Self {
594593
Self::ForwardedPaymentInboundClaim {
595594
channel_id: prev_hop.outpoint.to_channel_id(),
@@ -4549,6 +4548,7 @@ where
45494548
},
45504549
HTLCSource::PreviousHopData(hop_data) => {
45514550
let prev_outpoint = hop_data.outpoint;
4551+
let completed_blocker = RAAMonitorUpdateBlockingAction::from_prev_hop_data(&hop_data);
45524552
let res = self.claim_funds_from_hop(hop_data, payment_preimage,
45534553
|htlc_claim_value_msat| {
45544554
if let Some(forwarded_htlc_value) = forwarded_htlc_value_msat {
@@ -5490,6 +5490,23 @@ where
54905490
})
54915491
}
54925492

5493+
#[cfg(any(test, feature = "_test_utils"))]
5494+
pub(crate) fn test_raa_monitor_updates_held(&self, counterparty_node_id: PublicKey,
5495+
channel_id: [u8; 32])
5496+
-> bool {
5497+
let per_peer_state = self.per_peer_state.read().unwrap();
5498+
if let Some(peer_state_mtx) = per_peer_state.get(&counterparty_node_id) {
5499+
let mut peer_state_lck = peer_state_mtx.lock().unwrap();
5500+
let peer_state = &mut *peer_state_lck;
5501+
5502+
if let Some(chan) = peer_state.channel_by_id.get(&channel_id) {
5503+
return self.raa_monitor_updates_held(&peer_state.actions_blocking_raa_monitor_updates,
5504+
chan.get_funding_txo().unwrap(), counterparty_node_id);
5505+
}
5506+
}
5507+
false
5508+
}
5509+
54935510
fn internal_revoke_and_ack(&self, counterparty_node_id: &PublicKey, msg: &msgs::RevokeAndACK) -> Result<(), MsgHandleErrInternal> {
54945511
let (htlcs_to_fail, res) = {
54955512
let per_peer_state = self.per_peer_state.read().unwrap();

0 commit comments

Comments
 (0)