Skip to content

Commit 934336c

Browse files
jkczyzclaude
andcommitted
Add reason and splice parameters to splice failure events
An application handling SpliceNegotiationFailed had nothing to act on: the event did not say why the splice failed, nor what the failed call had attempted. Both matter for deciding what to do next — a fee bump lost to a disconnect can simply be re-issued, while the splice it meant to bump may still confirm at the prior feerate. Attach a reason, mapped from LDK's NegotiationFailureReason onto an ldk-node-owned enum so the event's serialization and bindings do not change with LDK's, and the parameters of the originating API call, taken from the persisted splice intent when the failure identifies it. Both fields are optional and serialized as odd TLVs: events written by LDK Node v0.7 read back as None, and v0.7 readers ignore the new fields. Developed with assistance from Claude Code. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 45a2463 commit 934336c

3 files changed

Lines changed: 302 additions & 5 deletions

File tree

‎src/channel/mod.rs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,11 @@ pub(crate) struct FailureSettlement<'a> {
504504
}
505505

506506
impl FailureSettlement<'_> {
507+
/// The parameters of the API call behind the splice the failure identifies, if any.
508+
pub(crate) fn originating_kind(&self) -> Option<&SpliceKind> {
509+
self.matched.as_ref().map(|(_, intent)| &intent.kind)
510+
}
511+
507512
/// Settles the snapshotted intent, if any. Call only once the user-facing failure event is
508513
/// durably queued.
509514
pub(crate) async fn settle(self) {

0 commit comments

Comments
 (0)