From 1fd05f3489fa065626a9fdc3a8a2d7c34aca1e53 Mon Sep 17 00:00:00 2001 From: Jesse de Wit Date: Fri, 12 Jul 2024 17:04:08 +0200 Subject: [PATCH] saturating sub payment fee --- libs/sdk-core/src/greenlight/node_api.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/sdk-core/src/greenlight/node_api.rs b/libs/sdk-core/src/greenlight/node_api.rs index ba47d239e..df3b10945 100644 --- a/libs/sdk-core/src/greenlight/node_api.rs +++ b/libs/sdk-core/src/greenlight/node_api.rs @@ -2198,7 +2198,7 @@ impl TryFrom for Payment { .as_ref() .map_or(0, |i| i.amount_msat.unwrap_or_default()), }, - fee_msat: payment_amount_sent - payment_amount, + fee_msat: payment_amount_sent.saturating_sub(payment_amount), status, error: None, description: ln_invoice.map(|i| i.description).unwrap_or_default(),