From cda939f33169591f1f4160c63c648a599190ca08 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 17 Nov 2016 14:59:44 +0100 Subject: fix exchangedb auditor functions to return proper serial ids --- src/exchangedb/plugin_exchangedb_postgres.c | 40 ++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index e92600cd4..6f3ededed 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -640,6 +640,7 @@ postgres_prepare (PGconn *db_conn) ",execution_date" ",sender_account_details" ",transfer_details" + ",reserve_in_serial_id" " FROM reserves_in" " WHERE reserve_in_serial_id>=$1" " ORDER BY reserve_in_serial_id", @@ -737,6 +738,7 @@ postgres_prepare (PGconn *db_conn) ",amount_with_fee_val" ",amount_with_fee_frac" ",amount_with_fee_curr" + ",reserve_out_serial_id" " FROM reserves_out" " WHERE reserve_out_serial_id>=$1" " ORDER BY reserve_out_serial_id ASC", @@ -773,6 +775,7 @@ postgres_prepare (PGconn *db_conn) ",amount_with_fee_curr" ",num_newcoins" ",noreveal_index" + ",melt_serial_id" " FROM refresh_sessions" " WHERE melt_serial_id>=$1" " ORDER BY melt_serial_id ASC", @@ -865,6 +868,7 @@ postgres_prepare (PGconn *db_conn) ",amount_with_fee_val" ",amount_with_fee_frac" ",amount_with_fee_curr" + ",refund_serial_id" " FROM refunds" " WHERE refund_serial_id>=$1" " ORDER BY refund_serial_id ASC", @@ -1006,6 +1010,7 @@ postgres_prepare (PGconn *db_conn) ",h_contract" ",wire" ",done" + ",deposit_serial_id" " FROM deposits" " WHERE (" " (deposit_serial_id>=$1)" @@ -1283,6 +1288,7 @@ postgres_prepare (PGconn *db_conn) " type" ",buf" ",finished" + ",prewire_uuid" " FROM prewire" " WHERE prewire_uuid>=$1" " ORDER BY prewire_uuid ASC", @@ -4393,6 +4399,7 @@ postgres_select_deposits_above_serial_id (void *cls, { struct TALER_EXCHANGEDB_Deposit deposit; uint8_t done = 0; + uint64_t rowid; struct GNUNET_PQ_ResultSpec rs[] = { TALER_PQ_result_spec_amount ("amount_with_fee", @@ -4417,6 +4424,8 @@ postgres_select_deposits_above_serial_id (void *cls, &deposit.receiver_wire_account), GNUNET_PQ_result_spec_auto_from_type ("done", &done), + GNUNET_PQ_result_spec_uint64 ("deposit_serial_id", + &rowid), GNUNET_PQ_result_spec_end }; if (GNUNET_OK != @@ -4427,7 +4436,7 @@ postgres_select_deposits_above_serial_id (void *cls, return GNUNET_SYSERR; } cb (cb_cls, - serial_id, + rowid, &deposit.merchant_pub, &deposit.coin.coin_pub, &deposit.csig, @@ -4498,6 +4507,7 @@ postgres_select_refreshs_above_serial_id (void *cls, struct TALER_Amount amount_with_fee; uint16_t num_newcoins; uint16_t noreveal_index; + uint64_t rowid; struct GNUNET_PQ_ResultSpec rs[] = { GNUNET_PQ_result_spec_auto_from_type ("old_coin_pub", @@ -4510,6 +4520,8 @@ postgres_select_refreshs_above_serial_id (void *cls, &num_newcoins), GNUNET_PQ_result_spec_uint16 ("noreveal_index", &noreveal_index), + GNUNET_PQ_result_spec_uint64 ("melt_serial_id", + &rowid), GNUNET_PQ_result_spec_end }; if (GNUNET_OK != @@ -4520,7 +4532,7 @@ postgres_select_refreshs_above_serial_id (void *cls, return GNUNET_SYSERR; } cb (cb_cls, - serial_id, + rowid, &coin_pub, &coin_sig, &amount_with_fee, @@ -4580,6 +4592,7 @@ postgres_select_refunds_above_serial_id (void *cls, for (i=0;i