diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-12-09 13:33:57 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-12-09 13:33:57 +0100 |
commit | d1c160d1b9bddfcd6f77148ae8a03944571fec25 (patch) | |
tree | f981900b86fa96e8e0baaa5c00c299d5c924e1dc /src/exchange/taler-exchange-httpd_purses_create.c | |
parent | f9cc76ad3c4d7a8c720e971a1a9cba1bb79fa974 (diff) |
properly handle GONE case on purse deposit
Diffstat (limited to 'src/exchange/taler-exchange-httpd_purses_create.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_purses_create.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_purses_create.c b/src/exchange/taler-exchange-httpd_purses_create.c index f3da2c85..130f9fae 100644 --- a/src/exchange/taler-exchange-httpd_purses_create.c +++ b/src/exchange/taler-exchange-httpd_purses_create.c @@ -201,6 +201,7 @@ create_transaction (void *cls, struct TEH_PurseDepositedCoin *coin = &pcc->coins[i]; bool balance_ok = false; bool conflict = true; + bool too_late = true; qs = TEH_make_coin_known (&coin->cpi, connection, @@ -215,6 +216,7 @@ create_transaction (void *cls, &coin->coin_sig, &coin->amount_minus_fee, &balance_ok, + &too_late, &conflict); if (qs <= 0) { @@ -243,6 +245,15 @@ create_transaction (void *cls, &coin->cpi.coin_pub); return GNUNET_DB_STATUS_HARD_ERROR; } + if (too_late) + { + *mhd_ret + = TALER_MHD_reply_with_ec ( + connection, + TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE, + "too late to deposit on purse creation"); + return GNUNET_DB_STATUS_HARD_ERROR; + } if (conflict) { struct TALER_Amount amount; |