summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-06-03 13:53:38 +0200
committerChristian Grothoff <christian@grothoff.org>2015-06-03 13:53:38 +0200
commit9e981afa3fccf52bc07be70197a4772ecceef606 (patch)
tree75bb0db6b47549f419656af8006baf33915a7c41 /src
parentda27bee6e48f2bb0be54b8cb0d3bbfcc5445fe7c (diff)
downloadexchange-9e981afa3fccf52bc07be70197a4772ecceef606.tar.gz
exchange-9e981afa3fccf52bc07be70197a4772ecceef606.tar.bz2
exchange-9e981afa3fccf52bc07be70197a4772ecceef606.zip
remarks on #3812
Diffstat (limited to 'src')
-rw-r--r--src/mintdb/plugin_mintdb_postgres.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mintdb/plugin_mintdb_postgres.c b/src/mintdb/plugin_mintdb_postgres.c
index 92a1a1571..05a21ec70 100644
--- a/src/mintdb/plugin_mintdb_postgres.c
+++ b/src/mintdb/plugin_mintdb_postgres.c
@@ -278,8 +278,8 @@ postgres_create_tables (void *cls,
/* Index blindcoins(reserve_pub) for get_reserves_blindcoins statement */
SQLEXEC_INDEX ("CREATE INDEX collectable_blindcoins_reserve_pub_index ON"
" collectable_blindcoins (reserve_pub)");
- /* Table with coins that have been (partially) spent, used to detect
- double-spending.
+ /* Table with coins that have been (partially) spent, used to track
+ coin information only once.
TODO: maybe eliminate, this might be over-normalization (#3811) */
SQLEXEC("CREATE TABLE IF NOT EXISTS known_coins "
"(coin_pub BYTEA NOT NULL PRIMARY KEY"
@@ -300,6 +300,16 @@ postgres_create_tables (void *cls,
",num_newcoins INT2 NOT NULL"
",noreveal_index INT2 NOT NULL"
")");
+ /* Table with coins that have been melted. Gives the coin's public
+ key (coin_pub), the melting session, the index of this coin in that
+ session, the signature affirming the melting and the amount that
+ this coin contributed to the melting session.
+ TODO: is this amount with or without fees? Should probably
+ be total (with fee), but then we should make that explicit
+ in the name. Also should we not include
+ both amounts (or also the fee explicitly) in the table
+ to ease auditing of operations?
+ */
SQLEXEC("CREATE TABLE IF NOT EXISTS refresh_melts "
"(coin_pub BYTEA NOT NULL REFERENCES known_coins (coin_pub)"
",session BYTEA NOT NULL REFERENCES refresh_sessions (session_hash)"