Skip to content

Commit

Permalink
Fix PendingHTLCsForwardable generation on deser
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinewallace committed Feb 9, 2023
1 parent 137b77c commit a067ae8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7515,7 +7515,16 @@ where
}
}

if !forward_htlcs.is_empty() {
let mut forward_ev_exists = false;
let mut intercept_count = 0;
for ev in &pending_events_read {
match ev {
events::Event::PendingHTLCsForwardable { .. } => { forward_ev_exists = true; break }
events::Event::HTLCIntercepted { .. } => intercept_count += 1,
_ => {}
}
}
if !forward_ev_exists && intercept_count < forward_htlcs.len() {
// If we have pending HTLCs to forward, assume we either dropped a
// `PendingHTLCsForwardable` or the user received it but never processed it as they
// shut down before the timer hit. Either way, set the time_forwardable to a small
Expand Down

0 comments on commit a067ae8

Please sign in to comment.