From e39beff2722683cfb7a2c70f2269795a074ee778 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 20 May 2016 15:52:40 +0200 Subject: fix init before use in new refund logic --- src/exchange/taler-exchange-httpd_responses.c | 2 +- src/exchangedb/plugin_exchangedb_postgres.c | 3 ++- src/include/taler_exchangedb_plugin.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c index 26f0d76a4..d3a73d38c 100644 --- a/src/exchange/taler-exchange-httpd_responses.c +++ b/src/exchange/taler-exchange-httpd_responses.c @@ -512,6 +512,7 @@ compile_transaction_history (const struct TALER_EXCHANGEDB_TransactionList *tl) TALER_amount_hton (&rr.refund_fee, &refund->refund_fee); /* internal sanity check before we hand out a bogus sig... */ + sig = &refund->merchant_sig.eddsa_sig; if (GNUNET_OK != GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND, &rr.purpose, @@ -522,7 +523,6 @@ compile_transaction_history (const struct TALER_EXCHANGEDB_TransactionList *tl) json_decref (history); return NULL; } - sig = &refund->merchant_sig.eddsa_sig; details = GNUNET_JSON_from_data (&rr.purpose, sizeof (struct TALER_RefundRequestPS)); } diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 4814468be..f53b23104 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -983,7 +983,8 @@ postgres_prepare (PGconn *db_conn) " WHERE" " tiny=false AND" " done=false AND" - " wire_deadline<$1" + " wire_deadline<=$1 AND" + " refund_deadline<$1" " ORDER BY wire_deadline ASC" " LIMIT 1", 1, NULL); diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 56e226071..6a3f9249c 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -1017,7 +1017,7 @@ struct TALER_EXCHANGEDB_Plugin /** * Obtain information about deposits that are ready to be executed. * Such deposits must not be marked as "tiny" or "done", and the - * execution time must be in the past. + * execution time and refund deadlines must both be in the past. * * @param cls the @e cls of this struct with the plugin-specific state * @param session connection to the database -- cgit v1.2.3