From 2c3145873426b7a37c08e77455eac19a80fb9556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Granh=C3=A3o?= <32176319+danielgranhao@users.noreply.github.com> Date: Wed, 28 Jun 2023 15:24:22 +0100 Subject: [PATCH] Remove unwrap of reason optional Co-authored-by: Andrei <92177534+andrei-21@users.noreply.github.com> --- eel/src/event_handler.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eel/src/event_handler.rs b/eel/src/event_handler.rs index 468ea01f..cb58c064 100644 --- a/eel/src/event_handler.rs +++ b/eel/src/event_handler.rs @@ -157,7 +157,11 @@ impl EventHandler for LipaEventHandler { .unwrap() .outgoing_payment_failed( &payment_hash, - PayErrorCode::from_failure_reason(reason.unwrap()), // `reason` could only be None if we deserialize events from old LDK versions + PayErrorCode::from_failure_reason( + reason.unwrap_or( + lightning::events::PaymentFailureReason::UnexpectedError, + ), + ), // `reason` could only be None if we deserialize events from old LDK versions ) .is_err() {