mirror of
https://github.com/aljazceru/cdk.git
synced 2026-01-23 14:55:48 +01:00
fix: melt transaction balanced
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user