diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-06-13 15:31:52 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-06-13 15:31:52 +0200 |
commit | 58a0882909f2b1ede572ae575b83c18746f96cff (patch) | |
tree | 8d96afaec04abb7fd82d32a7a1b8b4ca1e9dd52d /src/exchangedb/lrbt_callbacks.c | |
parent | 70a5ceecc1a15d4f811636f5980cedf653988879 (diff) |
-towards coin audits with purse deposits
Diffstat (limited to 'src/exchangedb/lrbt_callbacks.c')
-rw-r--r-- | src/exchangedb/lrbt_callbacks.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/exchangedb/lrbt_callbacks.c b/src/exchangedb/lrbt_callbacks.c index 7050199e5..b8ab49cf1 100644 --- a/src/exchangedb/lrbt_callbacks.c +++ b/src/exchangedb/lrbt_callbacks.c @@ -1550,6 +1550,51 @@ lrbt_cb_table_purse_requests (void *cls, /** + * Function called with purse_refunds table entries. + * + * @param cls closure + * @param result the postgres result + * @param num_results the number of results in @a result + */ +static void +lrbt_cb_table_purse_refunds (void *cls, + PGresult *result, + unsigned int num_results) +{ + struct LookupRecordsByTableContext *ctx = cls; + struct TALER_EXCHANGEDB_TableData td = { + .table = TALER_EXCHANGEDB_RT_PURSE_REFUNDS + }; + + for (unsigned int i = 0; i<num_results; i++) + { + struct GNUNET_PQ_ResultSpec rs[] = { + GNUNET_PQ_result_spec_uint64 ( + "purse_refunds_serial_id", + &td.serial), + GNUNET_PQ_result_spec_auto_from_type ( + "purse_pub", + &td.details.purse_refunds.purse_pub), + GNUNET_PQ_result_spec_end + }; + + if (GNUNET_OK != + GNUNET_PQ_extract_result (result, + rs, + i)) + { + GNUNET_break (0); + ctx->error = true; + return; + } + ctx->cb (ctx->cb_cls, + &td); + GNUNET_PQ_cleanup_result (rs); + } +} + + +/** * Function called with purse_merges table entries. * * @param cls closure |