summaryrefslogtreecommitdiff
path: root/src/auditordb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-10-06 16:54:09 +0200
committerChristian Grothoff <christian@grothoff.org>2019-10-06 16:54:09 +0200
commit165929a877c97e1061226bca961be5b4ab9f27fc (patch)
tree40bca14088b56be854ee5b3f131881c3ba0ce297 /src/auditordb
parente308d83f1bf4c59c034f91744c59296d97aba5fa (diff)
downloadexchange-165929a877c97e1061226bca961be5b4ab9f27fc.tar.gz
exchange-165929a877c97e1061226bca961be5b4ab9f27fc.tar.bz2
exchange-165929a877c97e1061226bca961be5b4ab9f27fc.zip
consider reserve closures as well when auditing outgoing wire transfers
Diffstat (limited to 'src/auditordb')
-rw-r--r--src/auditordb/plugin_auditordb_postgres.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/auditordb/plugin_auditordb_postgres.c b/src/auditordb/plugin_auditordb_postgres.c
index 287bef28..c8fd4f48 100644
--- a/src/auditordb/plugin_auditordb_postgres.c
+++ b/src/auditordb/plugin_auditordb_postgres.c
@@ -313,6 +313,7 @@ postgres_create_tables (void *cls)
GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS wire_auditor_progress"
"(master_pub BYTEA CONSTRAINT master_pub_ref REFERENCES auditor_exchanges(master_pub) ON DELETE CASCADE"
",last_timestamp INT8 NOT NULL"
+ ",last_reserve_close_uuid INT8 NOT NULL"
")"),
/* Table with all of the customer reserves and their respective
balances that the auditor is aware of.
@@ -753,18 +754,21 @@ postgres_prepare (PGconn *db_conn)
"INSERT INTO wire_auditor_progress "
"(master_pub"
",last_timestamp"
- ") VALUES ($1,$2);",
- 2),
+ ",last_reserve_close_uuid"
+ ") VALUES ($1,$2,$3);",
+ 3),
/* Used in #postgres_update_wire_auditor_progress() */
GNUNET_PQ_make_prepare ("wire_auditor_progress_update",
"UPDATE wire_auditor_progress SET "
" last_timestamp=$1"
- " WHERE master_pub=$2",
- 2),
+ ",last_reserve_close_uuid=$2"
+ " WHERE master_pub=$3",
+ 3),
/* Used in #postgres_get_wire_auditor_progress() */
GNUNET_PQ_make_prepare ("wire_auditor_progress_select",
"SELECT"
" last_timestamp"
+ ",last_reserve_close_uuid"
" FROM wire_auditor_progress"
" WHERE master_pub=$1;",
1),
@@ -2394,6 +2398,7 @@ postgres_insert_wire_auditor_progress (void *cls,
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub),
TALER_PQ_query_param_absolute_time (&pp->last_timestamp),
+ GNUNET_PQ_query_param_uint64 (&pp->last_reserve_close_uuid),
GNUNET_PQ_query_param_end
};
@@ -2423,6 +2428,7 @@ postgres_update_wire_auditor_progress (void *cls,
{
struct GNUNET_PQ_QueryParam params[] = {
TALER_PQ_query_param_absolute_time (&pp->last_timestamp),
+ GNUNET_PQ_query_param_uint64 (&pp->last_reserve_close_uuid),
GNUNET_PQ_query_param_auto_from_type (master_pub),
GNUNET_PQ_query_param_end
};
@@ -2456,6 +2462,8 @@ postgres_get_wire_auditor_progress (void *cls,
struct GNUNET_PQ_ResultSpec rs[] = {
TALER_PQ_result_spec_absolute_time ("last_timestamp",
&pp->last_timestamp),
+ GNUNET_PQ_result_spec_uint64 ("last_reserve_close_uuid",
+ &pp->last_reserve_close_uuid),
GNUNET_PQ_result_spec_end
};