commit 4fd5b73afb6930dc770461c8216e62aa55c72cc4
parent 979e51fde63c22e060976465c0345df9acc3ea6d
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 8 Nov 2026 23:25:19 +0100
correctly cap expected_fee at remaining balance before comparing
Diffstat:
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/src/auditor/taler-helper-auditor-reserves.c b/src/auditor/taler-helper-auditor-reserves.c
@@ -1211,17 +1211,26 @@ handle_reserve_closed (
{
GNUNET_break (0);
}
- else if (0 != TALER_amount_cmp (&expected_fee,
- closing_fee))
+ else
{
- report_amount_arithmetic_inconsistency (
- "closing aggregation fee",
- rowid,
- closing_fee,
- &expected_fee,
- 1);
- if (global_qs < 0)
- return GNUNET_SYSERR;
+ /* taler-exchange-closer never charges more than the remaining
+ balance: if the closing fee is not below it, the entire balance
+ is booked as the fee and nothing is wired. */
+ if (0 > TALER_amount_cmp (amount_with_fee,
+ &expected_fee))
+ expected_fee = *amount_with_fee;
+ if (0 != TALER_amount_cmp (&expected_fee,
+ closing_fee))
+ {
+ report_amount_arithmetic_inconsistency (
+ "closing aggregation fee",
+ rowid,
+ closing_fee,
+ &expected_fee,
+ 1);
+ if (global_qs < 0)
+ return GNUNET_SYSERR;
+ }
}
}