diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-12-05 11:15:59 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-12-05 11:15:59 +0100 |
commit | 461dc8e36ccc2e31799087bee4604c33bee9afc6 (patch) | |
tree | 800704428681ea66f1c19ea12fd76df4061447ed /src/exchange/taler-exchange-httpd_purses_deposit.c | |
parent | 07b4b1aa3f2c9ac74462ff3cb2b6a32c25e13c2e (diff) |
-fix crash if there is a conflict on inserting into the purse_decision table
Diffstat (limited to 'src/exchange/taler-exchange-httpd_purses_deposit.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_purses_deposit.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/exchange/taler-exchange-httpd_purses_deposit.c b/src/exchange/taler-exchange-httpd_purses_deposit.c index dc1a256d..0875ed2e 100644 --- a/src/exchange/taler-exchange-httpd_purses_deposit.c +++ b/src/exchange/taler-exchange-httpd_purses_deposit.c @@ -185,13 +185,14 @@ deposit_transaction (void *cls, { if (GNUNET_DB_STATUS_SOFT_ERROR == qs) return qs; + GNUNET_break (0 != qs); TALER_LOG_WARNING ( "Failed to store purse deposit information in database\n"); *mhd_ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_GENERIC_DB_STORE_FAILED, "do purse deposit"); - return qs; + return GNUNET_DB_STATUS_HARD_ERROR; } if (! balance_ok) { @@ -203,6 +204,9 @@ deposit_transaction (void *cls, &coin->cpi.coin_pub); return GNUNET_DB_STATUS_HARD_ERROR; } + // FIXME: there is also a 'conflict' case where the purse was already + // decided (fully paid up OR expired), we should probably distinguish + // those better! if (conflict) { struct TALER_Amount amount; |