summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-07-22 16:10:50 +0200
committerChristian Grothoff <christian@grothoff.org>2017-07-22 16:15:10 +0200
commit2d3fcf511582a69f4ee18a671b6cb2fba2dbdff6 (patch)
tree6e7f45836d90b3bb2b96e0ef975d3c250d8b2e0f
parent9626af456f4397102d0197134a9fc1140478b5a0 (diff)
downloadmerchant-2d3fcf511582a69f4ee18a671b6cb2fba2dbdff6.tar.gz
merchant-2d3fcf511582a69f4ee18a671b6cb2fba2dbdff6.tar.bz2
merchant-2d3fcf511582a69f4ee18a671b6cb2fba2dbdff6.zip
do not use uninitialized master_pub field from 'struct Exchange', but use the initialized master_pub from keys instead (when storing wire fee data in the database), should complete #4943 implementation
-rw-r--r--src/backend/taler-merchant-httpd_exchanges.c15
-rw-r--r--src/backend/taler-merchant-httpd_track-transfer.c3
2 files changed, 15 insertions, 3 deletions
diff --git a/src/backend/taler-merchant-httpd_exchanges.c b/src/backend/taler-merchant-httpd_exchanges.c
index a011be43..c4df9eaf 100644
--- a/src/backend/taler-merchant-httpd_exchanges.c
+++ b/src/backend/taler-merchant-httpd_exchanges.c
@@ -312,7 +312,12 @@ process_wire_fees (void *cls,
struct FeesByWireMethod *f;
struct TALER_EXCHANGE_WireAggregateFees *endp;
struct TALER_EXCHANGE_WireAggregateFees *af;
-
+ const struct TALER_EXCHANGE_Keys *keys;
+ const struct TALER_MasterPublicKeyP *master_pub;
+
+ keys = TALER_EXCHANGE_get_keys (exchange->conn);
+ GNUNET_assert (NULL != keys);
+ master_pub = &keys->master_pub;
for (f = exchange->wire_fees_head; NULL != f; f = f->next)
if (0 == strcasecmp (wire_method,
f->wire_method))
@@ -349,8 +354,14 @@ process_wire_fees (void *cls,
GNUNET_CRYPTO_hash (wire_method,
strlen (wire_method) + 1,
&h_wire_method);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Storing wire fee for `%s' and method `%s' at %s in DB; the fee is %s\n",
+ TALER_B2S (master_pub),
+ wire_method,
+ GNUNET_STRINGS_absolute_time_to_string (af->start_date),
+ TALER_amount2s (&af->wire_fee));
qs = db->store_wire_fee_by_exchange (db->cls,
- &exchange->master_pub,
+ master_pub,
&h_wire_method,
&af->wire_fee,
&af->closing_fee,
diff --git a/src/backend/taler-merchant-httpd_track-transfer.c b/src/backend/taler-merchant-httpd_track-transfer.c
index 4d55b7a9..f66457ab 100644
--- a/src/backend/taler-merchant-httpd_track-transfer.c
+++ b/src/backend/taler-merchant-httpd_track-transfer.c
@@ -533,8 +533,9 @@ check_wire_fee (struct TrackTransferContext *rctx,
if (0 >= qs)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Failed to find wire fee for `%s' at %s in DB, accepting blindly that the fee is %s\n",
+ "Failed to find wire fee for `%s' and method `%s' at %s in DB, accepting blindly that the fee is %s\n",
TALER_B2S (master_pub),
+ rctx->wire_method,
GNUNET_STRINGS_absolute_time_to_string (execution_time),
TALER_amount2s (wire_fee));
return GNUNET_NO;