diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-04-04 16:27:27 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-04-04 16:27:27 +0200 |
commit | 4b5efa4e8160634fc6cefce8dcedb38d71f76cc6 (patch) | |
tree | a07f3f48ec395ea5d940a672b7626a8bd4541360 /src/auditor/taler-auditor.c | |
parent | 4b82a591c54bec9720181358c8230caa3759363f (diff) |
towards supporting #3887 in the auditor
Diffstat (limited to 'src/auditor/taler-auditor.c')
-rw-r--r-- | src/auditor/taler-auditor.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/auditor/taler-auditor.c b/src/auditor/taler-auditor.c index b884e64bc..e89812a2a 100644 --- a/src/auditor/taler-auditor.c +++ b/src/auditor/taler-auditor.c @@ -808,9 +808,8 @@ handle_reserve_out (void *cls, * @param timestamp when did we receive the payback request * @param amount how much should be added back to the reserve * @param reserve_pub public key of the reserve - * @param coin_pub public key of the coin + * @param coin public information about the coin * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_PAYBACK - * @param h_denom_pub hash of the denomination key of the coin * @param coin_blind blinding factor used to blind the coin * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop */ @@ -820,9 +819,8 @@ handle_payback_by_reserve (void *cls, struct GNUNET_TIME_Absolute timestamp, const struct TALER_Amount *amount, const struct TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_CoinPublicInfo *coin, const struct TALER_CoinSpendSignatureP *coin_sig, - const struct GNUNET_HashCode *h_denom_pub, const struct TALER_DenominationBlindingKeyP *coin_blind) { struct ReserveContext *rc = cls; @@ -834,6 +832,9 @@ handle_payback_by_reserve (void *cls, GNUNET_assert (rowid >= pp.last_reserve_payback_serial_id); pp.last_reserve_payback_serial_id = rowid + 1; + /* TODO: check that coin signature on payback request is valid + and/or that the coin was eligible for payback! #3887!*/ + GNUNET_CRYPTO_hash (reserve_pub, sizeof (*reserve_pub), &key); @@ -1529,6 +1530,17 @@ check_transaction_history (const struct TALER_CoinSpendPublicKeyP *coin_pub, } } break; + case TALER_EXCHANGEDB_TT_PAYBACK: + amount_with_fee = &tl->details.payback->value; + if (GNUNET_OK != + TALER_amount_add (&expenditures, + &expenditures, + amount_with_fee)) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } + break; } /* Check that the fees given in the transaction list and in dki match */ @@ -1656,6 +1668,9 @@ wire_transfer_information_cb (void *cls, case TALER_EXCHANGEDB_TT_REFUND: coin = &tl->details.refund->coin; break; + case TALER_EXCHANGEDB_TT_PAYBACK: + coin = &tl->details.payback->coin; + break; } GNUNET_assert (NULL != coin); /* hard check that switch worked */ if (GNUNET_OK != |