From d192a6a6b4bb3fcde7c74856977534a9c1e8c454 Mon Sep 17 00:00:00 2001 From: Shroominic Date: Mon, 5 Jan 2026 00:34:58 +0100 Subject: [PATCH] fix not enough inputs to melt bug --- routstr/payment/lnurl.py | 2 +- routstr/wallet.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/routstr/payment/lnurl.py b/routstr/payment/lnurl.py index 04395311..b625fec1 100644 --- a/routstr/payment/lnurl.py +++ b/routstr/payment/lnurl.py @@ -283,7 +283,7 @@ async def raw_send_to_lnurl( f"({min_sendable_sat} - {max_sendable_sat} {unit})" ) - estimated_fees_sat = int(max(math.ceil((amount_msat / 1000) * 0.01), 2)) + estimated_fees_sat = int(max(math.ceil((amount_msat / 1000) * 0.01), 2)) + 1 estimated_fees_msat = estimated_fees_sat * 1000 final_amount = amount_msat - estimated_fees_msat diff --git a/routstr/wallet.py b/routstr/wallet.py index ca4834fa..7e8981b2 100644 --- a/routstr/wallet.py +++ b/routstr/wallet.py @@ -81,7 +81,7 @@ async def swap_to_primary_mint( amount_msat = token_amount else: raise ValueError("Invalid unit") - estimated_fee_sat = math.ceil(max(amount_msat // 1000 * 0.01, 2)) + estimated_fee_sat = math.ceil(max(amount_msat // 1000 * 0.01, 2)) + 1 amount_msat_after_fee = amount_msat - estimated_fee_sat * 1000 primary_wallet = await get_wallet(settings.primary_mint, settings.primary_mint_unit)