summaryrefslogtreecommitdiff
path: root/src/lib
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/lib
parent1554cc310d450ee5cfbf3afd947ed8a063043254 (diff)
downloadexchange-84a40be0bce66cda800de7891f758a0c69afc7fa.tar.gz
exchange-84a40be0bce66cda800de7891f758a0c69afc7fa.tar.bz2
exchange-84a40be0bce66cda800de7891f758a0c69afc7fa.zip
fix #6170 and rest of #6164
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/exchange_api_common.c16
-rw-r--r--src/lib/exchange_api_deposit.c4
-rw-r--r--src/lib/exchange_api_melt.c2
-rw-r--r--src/lib/exchange_api_refresh_common.c4
-rw-r--r--src/lib/exchange_api_transfers_get.c6
-rw-r--r--src/lib/exchange_api_withdraw.c4
6 files changed, 18 insertions, 18 deletions
diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c
index d441807a..07f5e187 100644
--- a/src/lib/exchange_api_common.c
+++ b/src/lib/exchange_api_common.c
@@ -117,7 +117,7 @@ TALER_EXCHANGE_parse_reserve_history (
};
rh->type = TALER_EXCHANGE_RTT_CREDIT;
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&total_in,
&total_in,
&amount))
@@ -233,7 +233,7 @@ TALER_EXCHANGE_parse_reserve_history (
}
uuid_off++;
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&total_out,
&total_out,
&amount))
@@ -301,7 +301,7 @@ TALER_EXCHANGE_parse_reserve_history (
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&total_in,
&total_in,
&rh->amount))
@@ -378,7 +378,7 @@ TALER_EXCHANGE_parse_reserve_history (
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&total_out,
&total_out,
&rh->amount))
@@ -398,7 +398,7 @@ TALER_EXCHANGE_parse_reserve_history (
}
/* check balance = total_in - total_out < withdraw-amount */
- if (GNUNET_SYSERR ==
+ if (0 >
TALER_amount_subtract (balance,
&total_in,
&total_out))
@@ -750,7 +750,7 @@ TALER_EXCHANGE_verify_coin_history (
if (GNUNET_YES == add)
{
/* This amount should be added to the total */
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (total,
total,
&amount))
@@ -768,7 +768,7 @@ TALER_EXCHANGE_verify_coin_history (
these negative amounts, as we might get refunds before
deposits from a semi-evil exchange. Then, at the end, we do
the subtraction by calculating "total = total - rtotal" */GNUNET_assert (GNUNET_NO == add);
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&rtotal,
&rtotal,
&amount))
@@ -781,7 +781,7 @@ TALER_EXCHANGE_verify_coin_history (
}
/* Finally, subtract 'rtotal' from total to handle the subtractions */
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_subtract (total,
total,
&rtotal))
diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c
index 38f15246..3c06bbe3 100644
--- a/src/lib/exchange_api_deposit.c
+++ b/src/lib/exchange_api_deposit.c
@@ -263,7 +263,7 @@ verify_deposit_signature_forbidden (
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&total,
&total,
&dh->amount_with_fee))
@@ -586,7 +586,7 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
GNUNET_break (0);
return NULL;
}
- if (GNUNET_SYSERR ==
+ if (0 >
TALER_amount_subtract (&amount_without_fee,
amount,
&dki->fee_deposit))
diff --git a/src/lib/exchange_api_melt.c b/src/lib/exchange_api_melt.c
index 0217757b..f89036e4 100644
--- a/src/lib/exchange_api_melt.c
+++ b/src/lib/exchange_api_melt.c
@@ -227,7 +227,7 @@ verify_melt_signature_conflict (struct TALER_EXCHANGE_MeltHandle *mh,
json_decref (history);
/* check if melt operation was really too expensive given history */
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&total,
&total,
&melt_value_with_fee))
diff --git a/src/lib/exchange_api_refresh_common.c b/src/lib/exchange_api_refresh_common.c
index f0468dc8..92217c5e 100644
--- a/src/lib/exchange_api_refresh_common.c
+++ b/src/lib/exchange_api_refresh_common.c
@@ -536,11 +536,11 @@ TALER_EXCHANGE_refresh_prepare (
{
md.fresh_pks[i].rsa_public_key
= GNUNET_CRYPTO_rsa_public_key_dup (fresh_pks[i].key.rsa_public_key);
- if ( (GNUNET_OK !=
+ if ( (0 >
TALER_amount_add (&total,
&total,
&fresh_pks[i].value)) ||
- (GNUNET_OK !=
+ (0 >
TALER_amount_add (&total,
&total,
&fresh_pks[i].fee_withdraw)) )
diff --git a/src/lib/exchange_api_transfers_get.c b/src/lib/exchange_api_transfers_get.c
index aa4abfa5..55253695 100644
--- a/src/lib/exchange_api_transfers_get.c
+++ b/src/lib/exchange_api_transfers_get.c
@@ -165,11 +165,11 @@ check_transfers_get_response_ok (
&detail->coin_value);
TALER_amount_hton (&dd.deposit_fee,
&detail->coin_fee);
- if ( (GNUNET_OK !=
+ if ( (0 >
TALER_amount_add (&total_expected,
&total_expected,
&detail->coin_value)) ||
- (GNUNET_OK !=
+ (0 >
TALER_amount_subtract (&total_expected,
&total_expected,
&detail->coin_fee)) )
@@ -216,7 +216,7 @@ check_transfers_get_response_ok (
return GNUNET_SYSERR;
}
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_subtract (&total_expected,
&total_expected,
&wire_fee))
diff --git a/src/lib/exchange_api_withdraw.c b/src/lib/exchange_api_withdraw.c
index c72454e2..6258053b 100644
--- a/src/lib/exchange_api_withdraw.c
+++ b/src/lib/exchange_api_withdraw.c
@@ -242,7 +242,7 @@ reserve_withdraw_payment_required (
return GNUNET_SYSERR;
}
/* Compute how much we expected to charge to the reserve */
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&requested_amount,
&wh->pk.value,
&wh->pk.fee_withdraw))
@@ -515,7 +515,7 @@ TALER_EXCHANGE_withdraw (
&req.reserve_pub.eddsa_pub);
req.purpose.size = htonl (sizeof (struct TALER_WithdrawRequestPS));
req.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW);
- if (GNUNET_OK !=
+ if (0 >
TALER_amount_add (&amount_with_fee,
&pk->fee_withdraw,
&pk->value))