diff options
| author | Christian Grothoff <christian@grothoff.org> | 2022-12-29 10:10:25 +0100 |
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2022-12-29 10:10:25 +0100 |
| commit | fa840f7071da56c4794c887b813ca2a6f491f836 (patch) | |
| tree | 7b126d737aa1fdc3df2ea60f76540af6011ea049 /src/exchange/taler-exchange-httpd_purses_deposit.c | |
| parent | 5828eead705965b5ac87cfad78636b1363b16396 (diff) | |
| parent | 915d6ddfaa638a9759766eaf69dfef7e8e17474b (diff) | |
Merge branch 'master' of git+ssh://git.taler.net/exchange
Diffstat (limited to 'src/exchange/taler-exchange-httpd_purses_deposit.c')
| -rw-r--r-- | src/exchange/taler-exchange-httpd_purses_deposit.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/exchange/taler-exchange-httpd_purses_deposit.c b/src/exchange/taler-exchange-httpd_purses_deposit.c index 4bebebf6..291807aa 100644 --- a/src/exchange/taler-exchange-httpd_purses_deposit.c +++ b/src/exchange/taler-exchange-httpd_purses_deposit.c @@ -374,6 +374,7 @@ TEH_handler_purses_deposit ( enum GNUNET_DB_QueryStatus qs; struct GNUNET_TIME_Timestamp create_timestamp; struct GNUNET_TIME_Timestamp merge_timestamp; + bool was_deleted; qs = TEH_plugin->select_purse ( TEH_plugin->cls, @@ -383,7 +384,8 @@ TEH_handler_purses_deposit ( &pcc.amount, &pcc.deposit_total, &pcc.h_contract_terms, - &merge_timestamp); + &merge_timestamp, + &was_deleted); switch (qs) { case GNUNET_DB_STATUS_HARD_ERROR: @@ -406,12 +408,16 @@ TEH_handler_purses_deposit ( case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: break; /* handled below */ } - if (GNUNET_TIME_absolute_is_past (pcc.purse_expiration.abs_time)) + if (GNUNET_TIME_absolute_is_past (pcc.purse_expiration.abs_time) || + was_deleted) { - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_GONE, - TALER_EC_EXCHANGE_GENERIC_PURSE_EXPIRED, - NULL); + return TALER_MHD_reply_with_error ( + connection, + MHD_HTTP_GONE, + was_deleted + ? TALER_EC_EXCHANGE_GENERIC_PURSE_DELETED + : TALER_EC_EXCHANGE_GENERIC_PURSE_EXPIRED, + GNUNET_TIME_timestamp2s (pcc.purse_expiration)); } } |
