Skip to content

Commit 7585934

Browse files
committed
fixup! Start publishing PaymentForwarded events.
1 parent 2bbd4c0 commit 7585934

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

bindings/ldk_node.udl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ interface Event {
277277
PaymentFailed(PaymentId? payment_id, PaymentHash? payment_hash, PaymentFailureReason? reason);
278278
PaymentReceived(PaymentId? payment_id, PaymentHash payment_hash, u64 amount_msat);
279279
PaymentClaimable(PaymentId payment_id, PaymentHash payment_hash, u64 claimable_amount_msat, u32? claim_deadline);
280-
PaymentForwarded(ChannelId prev_channel_id, ChannelId next_channel_id, UserChannelId prev_user_channel_id, UserChannelId? next_user_channel_id, u64? total_fee_earned_msat, u64? skimmed_fee_msat, boolean claim_from_onchain_tx, u64? outbound_amount_forwarded_msat);
280+
PaymentForwarded(ChannelId prev_channel_id, ChannelId next_channel_id, UserChannelId? prev_user_channel_id, UserChannelId? next_user_channel_id, u64? total_fee_earned_msat, u64? skimmed_fee_msat, boolean claim_from_onchain_tx, u64? outbound_amount_forwarded_msat);
281281
ChannelPending(ChannelId channel_id, UserChannelId user_channel_id, ChannelId former_temporary_channel_id, PublicKey counterparty_node_id, OutPoint funding_txo);
282282
ChannelReady(ChannelId channel_id, UserChannelId user_channel_id, PublicKey? counterparty_node_id);
283283
ChannelClosed(ChannelId channel_id, UserChannelId user_channel_id, PublicKey? counterparty_node_id, ClosureReason? reason);

src/event.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ pub enum Event {
112112
next_channel_id: ChannelId,
113113

114114
/// The `user_channel_id` of the incoming channel between the previous node and us.
115-
prev_user_channel_id: UserChannelId,
115+
///
116+
/// Will only be `None` for events serialized with LDK Node v0.3.0 or prior.
117+
prev_user_channel_id: Option<UserChannelId>,
116118

117119
/// The `user_channel_id` of the outgoing channel between the next node and us.
118120
///
@@ -1137,7 +1139,7 @@ where
11371139
let event = Event::PaymentForwarded {
11381140
prev_channel_id: prev_channel_id.expect("prev_channel_id expected for events generated by LDK versions greater than 0.0.107."),
11391141
next_channel_id: next_channel_id.expect("next_channel_id expected for events generated by LDK versions greater than 0.0.107."),
1140-
prev_user_channel_id: UserChannelId(prev_user_channel_id.expect("prev_user_channel_id expected for events generated by LDK versions greater than 0.0.122.")),
1142+
prev_user_channel_id: prev_user_channel_id.map(|u|UserChannelId(u)),
11411143
next_user_channel_id: next_user_channel_id.map(|u| UserChannelId(u)),
11421144
total_fee_earned_msat,
11431145
skimmed_fee_msat,

0 commit comments

Comments
 (0)