summaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-18 17:47:44 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-18 17:47:44 +0100
commit9cfe47493c29d3c6400258bcc98153c622dacb4e (patch)
tree225f7d14591ba6b95f60b7e4276a938fb95b3f43 /src/exchangedb
parent9a5cef0eb1d415eb2fce18a5d1b615b2f025ddd5 (diff)
downloadexchange-9cfe47493c29d3c6400258bcc98153c622dacb4e.tar.gz
exchange-9cfe47493c29d3c6400258bcc98153c622dacb4e.tar.bz2
exchange-9cfe47493c29d3c6400258bcc98153c622dacb4e.zip
more work on auditor
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c10
-rw-r--r--src/exchangedb/test_exchangedb.c2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index f686a8c52..c975edcff 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -490,7 +490,8 @@ postgres_create_tables (void *cls)
/* Table for the tracking API, mapping from wire transfer identifiers
to transactions and back */
SQLEXEC("CREATE TABLE IF NOT EXISTS aggregation_tracking "
- "(deposit_serial_id INT8 PRIMARY KEY REFERENCES deposits (deposit_serial_id) ON DELETE CASCADE"
+ "(aggregation_serial_id BIGSERIAL"
+ ",deposit_serial_id INT8 PRIMARY KEY REFERENCES deposits (deposit_serial_id) ON DELETE CASCADE"
",wtid_raw BYTEA CONSTRAINT wire_out_ref REFERENCES wire_out(wtid_raw) ON DELETE CASCADE DEFERRABLE"
",execution_time INT8 NOT NULL"
")");
@@ -1235,7 +1236,8 @@ postgres_prepare (PGconn *db_conn)
/* Used in #postgres_lookup_wire_transfer */
PREPARE ("lookup_transactions",
"SELECT"
- " deposits.h_proposal_data"
+ " aggregation_serial_id"
+ ",deposits.h_proposal_data"
",deposits.wire"
",deposits.h_wire"
",deposits.coin_pub"
@@ -4067,6 +4069,7 @@ postgres_lookup_wire_transfer (void *cls,
}
for (i=0;i<nrows;i++)
{
+ uint64_t rowid;
struct GNUNET_HashCode h_proposal_data;
struct GNUNET_HashCode h_wire;
struct TALER_CoinSpendPublicKeyP coin_pub;
@@ -4078,6 +4081,7 @@ postgres_lookup_wire_transfer (void *cls,
json_t *t;
const char *wire_method;
struct GNUNET_PQ_ResultSpec rs[] = {
+ GNUNET_PQ_result_spec_uint64 ("aggregation_serial_id", &rowid),
GNUNET_PQ_result_spec_auto_from_type ("h_proposal_data", &h_proposal_data),
TALER_PQ_result_spec_json ("wire", &wire),
GNUNET_PQ_result_spec_auto_from_type ("h_wire", &h_wire),
@@ -4088,6 +4092,7 @@ postgres_lookup_wire_transfer (void *cls,
TALER_PQ_result_spec_amount ("fee_deposit", &deposit_fee),
GNUNET_PQ_result_spec_end
};
+
if (GNUNET_OK !=
GNUNET_PQ_extract_result (result,
rs,
@@ -4112,6 +4117,7 @@ postgres_lookup_wire_transfer (void *cls,
return GNUNET_SYSERR;
}
cb (cb_cls,
+ rowid,
&merchant_pub,
wire_method,
&h_wire,
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c
index bfa1e6a23..93614ecb6 100644
--- a/src/exchangedb/test_exchangedb.c
+++ b/src/exchangedb/test_exchangedb.c
@@ -752,6 +752,7 @@ test_melting (struct TALER_EXCHANGEDB_Session *session)
*/
static void
cb_wt_never (void *cls,
+ uint64_t serial_id,
const struct TALER_MerchantPublicKeyP *merchant_pub,
const char *wire_method,
const struct GNUNET_HashCode *h_wire,
@@ -795,6 +796,7 @@ static struct TALER_WireTransferIdentifierRawP wtid_wt;
*/
static void
cb_wt_check (void *cls,
+ uint64_t rowid,
const struct TALER_MerchantPublicKeyP *merchant_pub,
const char *wire_method,
const struct GNUNET_HashCode *h_wire,