-more minor bugfixes

This commit is contained in:
Christian Grothoff 2022-06-07 16:57:12 +02:00
parent f0bcbf6586
commit 446761b602
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
5 changed files with 58 additions and 47 deletions

View File

@ -842,8 +842,6 @@ help_melt (struct CoinHistoryParseContext *pc,
return GNUNET_SYSERR;
}
if (NULL != pc->dk)
{
/* check that melt fee matches our expectations from /keys! */
if ( (GNUNET_YES !=
TALER_amount_cmp_currency (&melt_fee,
@ -855,8 +853,6 @@ help_melt (struct CoinHistoryParseContext *pc,
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
}
if (GNUNET_OK !=
TALER_wallet_melt_verify (
amount,
@ -946,8 +942,6 @@ help_refund (struct CoinHistoryParseContext *pc,
well-formendess check). */
/* check that refund fee matches our expectations from /keys! */
if (NULL != pc->dk)
{
if ( (GNUNET_YES !=
TALER_amount_cmp_currency (&refund_fee,
&pc->dk->fees.refund)) ||
@ -958,7 +952,6 @@ help_refund (struct CoinHistoryParseContext *pc,
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
}
return GNUNET_NO;
}

View File

@ -406,8 +406,9 @@ TALER_EXCHANGE_account_merge (
{
struct TALER_Amount zero_purse_fee;
GNUNET_assert (GNUNET_OK ==
TALER_amount_set_zero (purse_value_after_fees->currency,
&zero_purse_fee);
&zero_purse_fee));
TALER_wallet_account_merge_sign (merge_timestamp,
purse_pub,
purse_expiration,

View File

@ -1,6 +1,6 @@
/*
This file is part of TALER
Copyright (C) 2014-2021 Taler Systems SA
Copyright (C) 2014-2022 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@ -445,18 +445,31 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
{
rtotal = rh->refund_amount;
}
if (-1 == TALER_amount_cmp (&dtotal,
if ( (have_refund) && (! have_deposit) )
{
GNUNET_break (0);
GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
if (! (have_refund && have_deposit))
{
/* need both for a refund-deposit conflict proof */
GNUNET_break (0);
GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
if (-1 != TALER_amount_cmp (&dtotal,
&rtotal))
{
/* dtotal < rtotal: good! */
GNUNET_JSON_parse_free (spec);
return GNUNET_OK;
}
/* this fails to prove a conflict */
/* rtotal <= dtotal is fine, no conflict! */
GNUNET_break_op (0);
GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
/* dtotal < rtotal: that's a conflict! */
GNUNET_JSON_parse_free (spec);
return GNUNET_OK;
}
/**

View File

@ -311,6 +311,7 @@ TALER_EXCHANGE_reserves_history (
if (NULL == keys)
{
GNUNET_break (0);
curl_easy_cleanup (eh);
GNUNET_free (rsh->url);
GNUNET_free (rsh);
return NULL;
@ -320,6 +321,7 @@ TALER_EXCHANGE_reserves_history (
if (NULL == gf)
{
GNUNET_break_op (0);
curl_easy_cleanup (eh);
GNUNET_free (rsh->url);
GNUNET_free (rsh);
return NULL;

View File

@ -164,6 +164,8 @@ insert_deposit_run (void *cls,
0,
sizeof (deposit));
GNUNET_assert (
GNUNET_YES ==
GNUNET_CRYPTO_kdf (&merchant_priv,
sizeof (struct TALER_MerchantPrivateKeyP),
"merchant-priv",
@ -171,7 +173,7 @@ insert_deposit_run (void *cls,
ids->merchant_name,
strlen (ids->merchant_name),
NULL,
0);
0));
GNUNET_CRYPTO_eddsa_key_get_public (&merchant_priv.eddsa_priv,
&deposit.merchant_pub.eddsa_pub);
GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,