summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-08 23:52:01 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-08 23:52:01 +0200
commit84a40be0bce66cda800de7891f758a0c69afc7fa (patch)
treeaff8ee61032353024cf1a8429f0804162f81085a /src/exchange
parent1554cc310d450ee5cfbf3afd947ed8a063043254 (diff)
downloadexchange-84a40be0bce66cda800de7891f758a0c69afc7fa.tar.gz
exchange-84a40be0bce66cda800de7891f758a0c69afc7fa.tar.bz2
exchange-84a40be0bce66cda800de7891f758a0c69afc7fa.zip
fix #6170 and rest of #6164
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-aggregator.c10
-rw-r--r--src/exchange/taler-exchange-httpd_deposit.c4
-rw-r--r--src/exchange/taler-exchange-httpd_deposits_get.c2
-rw-r--r--src/exchange/taler-exchange-httpd_melt.c2
-rw-r--r--src/exchange/taler-exchange-httpd_recoup.c2
-rw-r--r--src/exchange/taler-exchange-httpd_refreshes_reveal.c4
-rw-r--r--src/exchange/taler-exchange-httpd_responses.c12
-rw-r--r--src/exchange/taler-exchange-httpd_transfers_get.c8
-rw-r--r--src/exchange/taler-exchange-httpd_withdraw.c2
9 files changed, 23 insertions, 23 deletions
diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c
index da24a125..0b98a342 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -312,7 +312,7 @@ refund_by_coin_cb (void *cls,
"Aggregator subtracts applicable refund of amount %s\n",
TALER_amount2s (amount_with_fee));
aux->have_refund = GNUNET_YES;
- if (GNUNET_SYSERR ==
+ if (0 >
TALER_amount_subtract (&aux->total_amount,
&aux->total_amount,
amount_with_fee))
@@ -385,7 +385,7 @@ deposit_cb (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Non-refunded transaction, subtracting deposit fee %s\n",
TALER_amount2s (deposit_fee));
- if (GNUNET_SYSERR ==
+ if (0 >
TALER_amount_subtract (&ntotal,
amount_with_fee,
deposit_fee))
@@ -571,7 +571,7 @@ aggregate_cb (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Subtracting deposit fee %s for non-refunded coin\n",
TALER_amount2s (deposit_fee));
- if (GNUNET_SYSERR ==
+ if (0 >
TALER_amount_subtract (&tmp,
&au->total_amount,
deposit_fee))
@@ -595,7 +595,7 @@ aggregate_cb (void *cls,
{
struct TALER_Amount tmp;
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&tmp,
&au->total_amount,
&old))
@@ -782,7 +782,7 @@ run_aggregation (void *cls)
/* Subtract wire transfer fee and round to the unit supported by the
wire transfer method; Check if after rounding down, we still have
an amount to transfer, and if not mark as 'tiny'. */
- if ( (GNUNET_OK !=
+ if ( (0 >=
TALER_amount_subtract (&au_active.final_amount,
&au_active.total_amount,
&au_active.wire_fee)) ||
diff --git a/src/exchange/taler-exchange-httpd_deposit.c b/src/exchange/taler-exchange-httpd_deposit.c
index ac854de6..d3439165 100644
--- a/src/exchange/taler-exchange-httpd_deposit.c
+++ b/src/exchange/taler-exchange-httpd_deposit.c
@@ -162,7 +162,7 @@ deposit_transaction (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"/deposit replay, accepting again!\n");
- GNUNET_assert (GNUNET_OK ==
+ GNUNET_assert (0 <=
TALER_amount_subtract (&amount_without_fee,
&deposit->amount_with_fee,
&deposit->deposit_fee));
@@ -543,7 +543,7 @@ TEH_handler_deposit (struct MHD_Connection *connection,
struct TALER_Amount amount_without_fee;
int res;
- GNUNET_assert (GNUNET_SYSERR !=
+ GNUNET_assert (0 <=
TALER_amount_subtract (&amount_without_fee,
&deposit.amount_with_fee,
&deposit.deposit_fee));
diff --git a/src/exchange/taler-exchange-httpd_deposits_get.c b/src/exchange/taler-exchange-httpd_deposits_get.c
index f2b364ca..04d24f49 100644
--- a/src/exchange/taler-exchange-httpd_deposits_get.c
+++ b/src/exchange/taler-exchange-httpd_deposits_get.c
@@ -176,7 +176,7 @@ handle_wtid_data (void *cls,
ctx->execution_time = execution_time;
return;
}
- if (GNUNET_SYSERR ==
+ if (0 >
TALER_amount_subtract (&ctx->coin_delta,
coin_contribution,
coin_fee))
diff --git a/src/exchange/taler-exchange-httpd_melt.c b/src/exchange/taler-exchange-httpd_melt.c
index fab0f106..c08c9773 100644
--- a/src/exchange/taler-exchange-httpd_melt.c
+++ b/src/exchange/taler-exchange-httpd_melt.c
@@ -249,7 +249,7 @@ refresh_check_melt (struct MHD_Connection *connection,
{
struct TALER_Amount coin_residual;
- GNUNET_assert (GNUNET_SYSERR !=
+ GNUNET_assert (0 <=
TALER_amount_subtract (&coin_residual,
&spent,
&rmc->refresh_session.amount_with_fee));
diff --git a/src/exchange/taler-exchange-httpd_recoup.c b/src/exchange/taler-exchange-httpd_recoup.c
index ccb75622..a3014e78 100644
--- a/src/exchange/taler-exchange-httpd_recoup.c
+++ b/src/exchange/taler-exchange-httpd_recoup.c
@@ -242,7 +242,7 @@ recoup_transaction (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Recoup: coin value %s\n",
TALER_amount2s (&pc->value));
- if (GNUNET_SYSERR ==
+ if (0 >
TALER_amount_subtract (&pc->amount,
&pc->value,
&spent))
diff --git a/src/exchange/taler-exchange-httpd_refreshes_reveal.c b/src/exchange/taler-exchange-httpd_refreshes_reveal.c
index 5b6ca2d3..da1b3eb9 100644
--- a/src/exchange/taler-exchange-httpd_refreshes_reveal.c
+++ b/src/exchange/taler-exchange-httpd_refreshes_reveal.c
@@ -436,11 +436,11 @@ refreshes_reveal_transaction (void *cls,
&rctx->dkis[i]->issue.properties.fee_withdraw);
TALER_amount_ntoh (&value,
&rctx->dkis[i]->issue.properties.value);
- if ( (GNUNET_OK !=
+ if ( (0 >
TALER_amount_add (&total,
&fee_withdraw,
&value)) ||
- (GNUNET_OK !=
+ (0 >
TALER_amount_add (&refresh_cost,
&refresh_cost,
&total)) )
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c
index 4ddd9cd8..3870db14 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -200,7 +200,7 @@ TEH_RESPONSE_compile_transaction_history (
return NULL;
}
#endif
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_subtract (&value,
&refund->refund_amount,
&refund->refund_fee))
@@ -481,7 +481,7 @@ TEH_RESPONSE_compile_reserve_history (
credit_total = bank->amount;
init |= IA_CREDIT;
}
- else if (GNUNET_OK !=
+ else if (0 >
TALER_amount_add (&credit_total,
&credit_total,
&bank->amount))
@@ -526,7 +526,7 @@ TEH_RESPONSE_compile_reserve_history (
}
else
{
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&withdraw_total,
&withdraw_total,
&value))
@@ -572,7 +572,7 @@ TEH_RESPONSE_compile_reserve_history (
credit_total = recoup->value;
init |= IA_CREDIT;
}
- else if (GNUNET_OK !=
+ else if (0 >
TALER_amount_add (&credit_total,
&credit_total,
&recoup->value))
@@ -642,7 +642,7 @@ TEH_RESPONSE_compile_reserve_history (
}
else
{
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&withdraw_total,
&withdraw_total,
&value))
@@ -724,7 +724,7 @@ TEH_RESPONSE_compile_reserve_history (
TALER_amount_get_zero (credit_total.currency,
&withdraw_total));
}
- if (GNUNET_SYSERR ==
+ if (0 >
TALER_amount_subtract (balance,
&credit_total,
&withdraw_total))
diff --git a/src/exchange/taler-exchange-httpd_transfers_get.c b/src/exchange/taler-exchange-httpd_transfers_get.c
index 4cc855d7..2aa9a5c9 100644
--- a/src/exchange/taler-exchange-httpd_transfers_get.c
+++ b/src/exchange/taler-exchange-httpd_transfers_get.c
@@ -314,7 +314,7 @@ handle_deposit_data (void *cls,
ctx->exec_time = exec_time;
ctx->wire_method = wire_method; /* captures the reference */
ctx->is_valid = GNUNET_YES;
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_subtract (&ctx->total,
deposit_value,
deposit_fee))
@@ -343,7 +343,7 @@ handle_deposit_data (void *cls,
return;
}
GNUNET_free (wire_method);
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_subtract (&delta,
deposit_value,
deposit_fee))
@@ -352,7 +352,7 @@ handle_deposit_data (void *cls,
ctx->is_valid = GNUNET_SYSERR;
return;
}
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&ctx->total,
&ctx->total,
&delta))
@@ -489,7 +489,7 @@ get_transfer_deposits (void *cls,
}
return qs;
}
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_subtract (&ctx->total,
&ctx->total,
&ctx->wire_fee))
diff --git a/src/exchange/taler-exchange-httpd_withdraw.c b/src/exchange/taler-exchange-httpd_withdraw.c
index 58ef97ba..152ebfbb 100644
--- a/src/exchange/taler-exchange-httpd_withdraw.c
+++ b/src/exchange/taler-exchange-httpd_withdraw.c
@@ -422,7 +422,7 @@ TEH_handler_withdraw (const struct TEH_RequestHandler *rh,
&wc.dki->issue.properties.value);
TALER_amount_ntoh (&fee_withdraw,
&wc.dki->issue.properties.fee_withdraw);
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&wc.amount_required,
&amount,
&fee_withdraw))