aboutsummaryrefslogtreecommitdiff
path: root/src/mintdb/plugin_mintdb_postgres.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-06-03 14:39:45 +0200
committerChristian Grothoff <christian@grothoff.org>2015-06-03 14:39:45 +0200
commit321208972d64cdbada8270c1ef0453e7e11fe18b (patch)
tree5f501d442e5e5dbd87dacf67646e101fcb7bfa93 /src/mintdb/plugin_mintdb_postgres.c
parent1f8291a024fe990211b2fbee550ec7fc166b2b6e (diff)
remarks on #3816
Diffstat (limited to 'src/mintdb/plugin_mintdb_postgres.c')
-rw-r--r--src/mintdb/plugin_mintdb_postgres.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mintdb/plugin_mintdb_postgres.c b/src/mintdb/plugin_mintdb_postgres.c
index 9f4eee76a..17d8f6252 100644
--- a/src/mintdb/plugin_mintdb_postgres.c
+++ b/src/mintdb/plugin_mintdb_postgres.c
@@ -339,7 +339,7 @@ postgres_create_tables (void *cls,
NOTE: We might want to simplify this and not have the oldcoin_index
and instead store all link secrets, one after the other, in one big BYTEA.
(#3814) */
- SQLEXEC("CREATE TABLE IF NOT EXISTS refresh_commit_link"
+ SQLEXEC("CREATE TABLE IF NOT EXISTS refresh_commit_link "
"(session_hash BYTEA NOT NULL REFERENCES refresh_sessions (session_hash)"
",transfer_pub BYTEA NOT NULL CHECK(LENGTH(transfer_pub)=32)"
",link_secret_enc BYTEA NOT NULL"
@@ -357,14 +357,18 @@ postgres_create_tables (void *cls,
newcoin_index and instead store all coin_evs and
link_vector_encs, one after the other, in two big BYTEAs.
(#3815) */
- SQLEXEC("CREATE TABLE IF NOT EXISTS refresh_commit_coin"
+ SQLEXEC("CREATE TABLE IF NOT EXISTS refresh_commit_coin "
"(session_hash BYTEA NOT NULL REFERENCES refresh_sessions (session_hash) "
",link_vector_enc BYTEA NOT NULL"
",newcoin_index INT2 NOT NULL"
",cnc_index INT2 NOT NULL"
",coin_ev BYTEA NOT NULL"
")");
- SQLEXEC("CREATE TABLE IF NOT EXISTS refresh_collectable"
+ /* Table with the signatures over coins generated during a refresh
+ operation. Needed to answer /refresh/link queries later. Stores
+ the coin signatures under the respective session hash and index.
+ NOTE: maybe rename the table to explain better what it is for? (#3810) */
+ SQLEXEC("CREATE TABLE IF NOT EXISTS refresh_collectable "
"(session_hash BYTEA NOT NULL CHECK(LENGTH(session_hash)=64) REFERENCES refresh_sessions (session_hash) "
",ev_sig BYTEA NOT NULL"
",newcoin_index INT2 NOT NULL"
@@ -376,7 +380,7 @@ postgres_create_tables (void *cls,
may not be unique if a wallet chooses not to refresh. The
resulting transaction ID should then be returned to the merchant
and could be used by the mearchant for further inquriries about
- the deposit's execution. */
+ the deposit's execution. (#3816) */
SQLEXEC("CREATE TABLE IF NOT EXISTS deposits "
/* FIXME #3769: the following primary key may be too restrictive */
"(coin_pub BYTEA NOT NULL PRIMARY KEY CHECK (LENGTH(coin_pub)=32)"
@@ -626,7 +630,7 @@ postgres_prepare (PGconn *db_conn)
") VALUES "
"($1, $2, $3, $4, $5);",
5, NULL);
-#if 0 /* FIXME: not complete yet */
+ /* NOTE: order differs from 'CREATE TABLE' statement, might want to fix */
PREPARE ("insert_refresh_commit_coin",
"INSERT INTO refresh_commit_coin "
"(session_hash"
@@ -637,6 +641,7 @@ postgres_prepare (PGconn *db_conn)
") VALUES "
"($1, $2, $3, $4, $5);",
5, NULL);
+#if 0 /* FIXME: not complete yet */
PREPARE ("insert_refresh_collectable",
"INSERT INTO refresh_collectable "
"(session_hash"