From 9b4d0634e15fd026a887b4e425abc2a75ddeff04 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 19 Mar 2017 01:55:37 +0100 Subject: simplify analysis by returning denom_pub with rest of coin transaction data instead of bothering fetching with coin history --- src/exchangedb/plugin_exchangedb_postgres.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/exchangedb/plugin_exchangedb_postgres.c') diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index f57ac5a2..536a5588 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -799,7 +799,7 @@ postgres_prepare (PGconn *db_conn) ",denom.fee_refresh_curr " ",num_newcoins" ",noreveal_index" - " FROM refresh_sessions " + " FROM refresh_sessions" " JOIN known_coins ON (refresh_sessions.old_coin_pub = known_coins.coin_pub)" " JOIN denominations denom USING (denom_pub)" " WHERE session_hash=$1 ", @@ -809,7 +809,8 @@ postgres_prepare (PGconn *db_conn) refresh session with id '\geq' the given parameter */ PREPARE ("audit_get_refresh_sessions_incr", "SELECT" - " old_coin_pub" + " known_coins.denom_pub" + ",old_coin_pub" ",old_coin_sig" ",amount_with_fee_val" ",amount_with_fee_frac" @@ -819,6 +820,7 @@ postgres_prepare (PGconn *db_conn) ",melt_serial_id" ",session_hash" " FROM refresh_sessions" + " JOIN known_coins ON (refresh_sessions.old_coin_pub = known_coins.coin_pub)" " WHERE melt_serial_id>=$1" " ORDER BY melt_serial_id ASC", 1, NULL); @@ -905,12 +907,14 @@ postgres_prepare (PGconn *db_conn) ",merchant_sig" ",h_proposal_data" ",rtransaction_id" + ",known_coins.denom_pub" ",coin_pub" ",amount_with_fee_val" ",amount_with_fee_frac" ",amount_with_fee_curr" ",refund_serial_id" " FROM refunds" + " JOIN known_coins ON (coin_pub)" " WHERE refund_serial_id>=$1" " ORDER BY refund_serial_id ASC", 1, NULL); @@ -1040,6 +1044,7 @@ postgres_prepare (PGconn *db_conn) ",amount_with_fee_curr" ",timestamp" ",merchant_pub" + ",known_coins.denom_pub" ",coin_pub" ",coin_sig" ",refund_deadline" @@ -1049,6 +1054,7 @@ postgres_prepare (PGconn *db_conn) ",done" ",deposit_serial_id" " FROM deposits" + " JOIN known_coins ON (coin_pub)" " WHERE (" " (deposit_serial_id>=$1)" " )" @@ -4853,6 +4859,7 @@ postgres_select_deposits_above_serial_id (void *cls, for (i=0;i