Skip to content

Commit 7a3013b

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 b4ee03d commit 7a3013b

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
@@ -6515,7 +6515,10 @@ impl<SP: Deref> FundedChannel<SP> where
65156515
}
65166516
}
65176517
}
6518-
self.funding.value_to_self_msat = (self.funding.value_to_self_msat as i64 + value_to_self_msat_diff) as u64;
6518+
6519+
for funding in core::iter::once(&mut self.funding).chain(self.pending_funding.iter_mut()) {
6520+
funding.value_to_self_msat = (funding.value_to_self_msat as i64 + value_to_self_msat_diff) as u64;
6521+
}
65196522

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

0 commit comments

Comments
 (0)