summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_refresh_melt.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-10-19 11:01:40 +0200
committerChristian Grothoff <christian@grothoff.org>2018-10-19 11:01:49 +0200
commitfb952babf67c41dedf3fac6b9d89eccf7fc10b2e (patch)
tree2194d42b483b70cb01acc7a36e6e6b9821720376 /src/exchange/taler-exchange-httpd_refresh_melt.c
parent9114794bee49af5d7c38d7f69a31808e4dedb6b1 (diff)
downloadexchange-fb952babf67c41dedf3fac6b9d89eccf7fc10b2e.tar.gz
exchange-fb952babf67c41dedf3fac6b9d89eccf7fc10b2e.tar.bz2
exchange-fb952babf67c41dedf3fac6b9d89eccf7fc10b2e.zip
reduce redundant data fetch (#5444)
Diffstat (limited to 'src/exchange/taler-exchange-httpd_refresh_melt.c')
-rw-r--r--src/exchange/taler-exchange-httpd_refresh_melt.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/exchange/taler-exchange-httpd_refresh_melt.c b/src/exchange/taler-exchange-httpd_refresh_melt.c
index a844d3a4b..476188dea 100644
--- a/src/exchange/taler-exchange-httpd_refresh_melt.c
+++ b/src/exchange/taler-exchange-httpd_refresh_melt.c
@@ -252,20 +252,22 @@ refresh_melt_transaction (void *cls,
struct RefreshMeltContext *rmc = cls;
struct TALER_EXCHANGEDB_RefreshMelt rm;
enum GNUNET_DB_QueryStatus qs;
+ uint32_t noreveal_index;
/* Check if we already created such a session */
- qs = TEH_plugin->get_melt (TEH_plugin->cls,
- session,
- &rmc->refresh_session.rc,
- &rm);
+ qs = TEH_plugin->get_melt_index (TEH_plugin->cls,
+ session,
+ &rmc->refresh_session.rc,
+ &noreveal_index);
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs)
{
TALER_LOG_DEBUG ("Found already-melted coin\n");
*mhd_ret = reply_refresh_melt_success (connection,
&rmc->refresh_session.rc,
- rm.session.noreveal_index);
- /* FIXME: is it normal to return "hard error" upon
- * _finding_ some data into the database? */
+ noreveal_index);
+ /* Note: we return "hard error" to ensure the wrapper
+ does not retry the transaction, and to also not generate
+ a "fresh" response (as we would on "success") */
return GNUNET_DB_STATUS_HARD_ERROR;
}
if (0 > qs)