diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-07-22 16:10:50 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-07-22 16:15:10 +0200 |
commit | 2d3fcf511582a69f4ee18a671b6cb2fba2dbdff6 (patch) | |
tree | 6e7f45836d90b3bb2b96e0ef975d3c250d8b2e0f /src/backend/taler-merchant-httpd_exchanges.c | |
parent | 9626af456f4397102d0197134a9fc1140478b5a0 (diff) |
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
Diffstat (limited to 'src/backend/taler-merchant-httpd_exchanges.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_exchanges.c | 15 |
1 files changed, 13 insertions, 2 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, |