Skip to content

Commit 3b8dabb

Browse files
committed
Handle event_queue push failure in ChannelPending.
1 parent 59f3e18 commit 3b8dabb

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/event.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,18 +1129,20 @@ where
11291129
channel_id,
11301130
counterparty_node_id,
11311131
);
1132-
self.event_queue
1133-
.add_event(Event::ChannelPending {
1134-
channel_id,
1135-
user_channel_id: UserChannelId(user_channel_id),
1136-
former_temporary_channel_id: former_temporary_channel_id.unwrap(),
1137-
counterparty_node_id,
1138-
funding_txo,
1139-
})
1140-
.unwrap_or_else(|e| {
1132+
match self.event_queue.add_event(Event::ChannelPending {
1133+
channel_id,
1134+
user_channel_id: UserChannelId(user_channel_id),
1135+
former_temporary_channel_id: former_temporary_channel_id.unwrap(),
1136+
counterparty_node_id,
1137+
funding_txo,
1138+
}) {
1139+
Ok(_) => {},
1140+
Err(e) => {
11411141
log_error!(self.logger, "Failed to push to event queue: {}", e);
1142-
panic!("Failed to push to event queue");
1143-
});
1142+
return Err(ReplayEvent());
1143+
},
1144+
};
1145+
11441146
let network_graph = self.network_graph.read_only();
11451147
let channels =
11461148
self.channel_manager.list_channels_with_counterparty(&counterparty_node_id);

0 commit comments

Comments
 (0)