diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-12-08 15:18:40 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-12-08 15:18:40 +0100 |
commit | 9d3f7d3a56712d6a963e8a4775a8f9757740d648 (patch) | |
tree | 95955e48fffa2d6dfcf6e81083b43c3df40f2072 /src/exchange/taler-exchange-httpd_recoup.c | |
parent | 2e6e2387b8c4e83e32c50e4fc8cb5312bce68735 (diff) |
move ensure_coin_known for melt and recoup outside of transaction, more logging
Diffstat (limited to 'src/exchange/taler-exchange-httpd_recoup.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_recoup.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/exchange/taler-exchange-httpd_recoup.c b/src/exchange/taler-exchange-httpd_recoup.c index 7ea345b8..fd8baf65 100644 --- a/src/exchange/taler-exchange-httpd_recoup.c +++ b/src/exchange/taler-exchange-httpd_recoup.c @@ -130,13 +130,6 @@ recoup_transaction (void *cls, enum GNUNET_DB_QueryStatus qs; int existing_recoup_found; - /* make sure coin is 'known' in database */ - qs = TEH_make_coin_known (pc->coin, - connection, - mhd_ret); - if (qs < 0) - return qs; - /* Check whether a recoup is allowed, and if so, to which reserve / account the money should go */ if (pc->refreshed) @@ -471,6 +464,21 @@ verify_and_execute_recoup ( pc.coin_bks = coin_bks; pc.coin = coin; pc.refreshed = refreshed; + + { + MHD_RESULT mhd_ret = MHD_NO; + enum GNUNET_DB_QueryStatus qs; + + /* make sure coin is 'known' in database */ + qs = TEH_make_coin_known (coin, + connection, + &mhd_ret); + /* no transaction => no serialization failures should be possible */ + GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR != qs); + if (qs < 0) + return mhd_ret; + } + { MHD_RESULT mhd_ret; |