Skip to content

Commit d98adeb

Browse files
committed
Update pending funding when handling revoke_and_ack
If there are any pending splices when a revoke_and_ack message is received, FundingScope::value_to_self_msat needs to be updated for each. Otherwise, the promoted FundingScope will be invalid when the splice is locked.
1 parent afe4d64 commit d98adeb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lightning/src/ln/channel.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6516,7 +6516,10 @@ impl<SP: Deref> FundedChannel<SP> where
65166516
}
65176517
}
65186518
}
6519-
self.funding.value_to_self_msat = (self.funding.value_to_self_msat as i64 + value_to_self_msat_diff) as u64;
6519+
6520+
for funding in core::iter::once(&mut self.funding).chain(self.pending_funding.iter_mut()) {
6521+
funding.value_to_self_msat = (funding.value_to_self_msat as i64 + value_to_self_msat_diff) as u64;
6522+
}
65206523

65216524
if let Some((feerate, update_state)) = self.context.pending_update_fee {
65226525
match update_state {

0 commit comments

Comments
 (0)