This commit is contained in:
Christian Grothoff 2015-06-03 14:39:45 +02:00
parent 1f8291a024
commit 321208972d

View File

@ -364,6 +364,10 @@ postgres_create_tables (void *cls,
",cnc_index INT2 NOT NULL" ",cnc_index INT2 NOT NULL"
",coin_ev BYTEA NOT NULL" ",coin_ev BYTEA NOT NULL"
")"); ")");
/* 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 " SQLEXEC("CREATE TABLE IF NOT EXISTS refresh_collectable "
"(session_hash BYTEA NOT NULL CHECK(LENGTH(session_hash)=64) REFERENCES refresh_sessions (session_hash) " "(session_hash BYTEA NOT NULL CHECK(LENGTH(session_hash)=64) REFERENCES refresh_sessions (session_hash) "
",ev_sig BYTEA NOT NULL" ",ev_sig BYTEA NOT NULL"
@ -376,7 +380,7 @@ postgres_create_tables (void *cls,
may not be unique if a wallet chooses not to refresh. The may not be unique if a wallet chooses not to refresh. The
resulting transaction ID should then be returned to the merchant resulting transaction ID should then be returned to the merchant
and could be used by the mearchant for further inquriries about 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 " SQLEXEC("CREATE TABLE IF NOT EXISTS deposits "
/* FIXME #3769: the following primary key may be too restrictive */ /* FIXME #3769: the following primary key may be too restrictive */
"(coin_pub BYTEA NOT NULL PRIMARY KEY CHECK (LENGTH(coin_pub)=32)" "(coin_pub BYTEA NOT NULL PRIMARY KEY CHECK (LENGTH(coin_pub)=32)"
@ -626,7 +630,7 @@ postgres_prepare (PGconn *db_conn)
") VALUES " ") VALUES "
"($1, $2, $3, $4, $5);", "($1, $2, $3, $4, $5);",
5, NULL); 5, NULL);
#if 0 /* FIXME: not complete yet */ /* NOTE: order differs from 'CREATE TABLE' statement, might want to fix */
PREPARE ("insert_refresh_commit_coin", PREPARE ("insert_refresh_commit_coin",
"INSERT INTO refresh_commit_coin " "INSERT INTO refresh_commit_coin "
"(session_hash" "(session_hash"
@ -637,6 +641,7 @@ postgres_prepare (PGconn *db_conn)
") VALUES " ") VALUES "
"($1, $2, $3, $4, $5);", "($1, $2, $3, $4, $5);",
5, NULL); 5, NULL);
#if 0 /* FIXME: not complete yet */
PREPARE ("insert_refresh_collectable", PREPARE ("insert_refresh_collectable",
"INSERT INTO refresh_collectable " "INSERT INTO refresh_collectable "
"(session_hash" "(session_hash"