fix: melt transaction balanced

This commit is contained in:
thesimplekid
2024-09-18 16:27:01 +02:00
parent 88b79eb9e9
commit 725f59af04

View File

@@ -330,7 +330,7 @@ pub async fn post_melt_bolt11(
.map_err(|_| into_response(Error::UnitUnsupported))?,
};
if amount_to_pay + quote.fee_reserve != inputs_amount_quote_unit {
if amount_to_pay + quote.fee_reserve > inputs_amount_quote_unit {
tracing::debug!(
"Not enough inuts provided: {} msats needed {} msats",
inputs_amount_quote_unit,
@@ -340,6 +340,7 @@ pub async fn post_melt_bolt11(
if let Err(err) = state.mint.process_unpaid_melt(&payload).await {
tracing::error!("Could not reset melt quote state: {}", err);
}
return Err(into_response(Error::TransactionUnbalanced(
inputs_amount_quote_unit.into(),
amount_to_pay.into(),