Skip to content

Commit 07156ce

Browse files
committed
Document ChannelPending temporary id invariant
Replace the pending-channel unwrap with an expect that records why supported LDK Node state should always include the former temporary channel id. Older rust-lightning state could omit it, but LDK Node never shipped before that field existed. Co-Authored-By: HAL 9000
1 parent b116c85 commit 07156ce

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/event.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,8 +1452,9 @@ where
14521452
counterparty_node_id,
14531453
);
14541454

1455-
#[allow(clippy::unwrap_used)]
1456-
let former_temporary_channel_id = former_temporary_channel_id.unwrap();
1455+
let former_temporary_channel_id = former_temporary_channel_id.expect(
1456+
"LDK Node has only ever persisted ChannelPending events from rust-lightning 0.0.115 or later",
1457+
);
14571458

14581459
let event = Event::ChannelPending {
14591460
channel_id,

0 commit comments

Comments
 (0)