summaryrefslogtreecommitdiff
path: root/src/exchangedb/plugin_exchangedb_postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/plugin_exchangedb_postgres.c')
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index 3095529d9..df0c1a5fc 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -516,7 +516,7 @@ postgres_create_tables (void *cls)
/* Table for /payback information */
SQLEXEC("CREATE TABLE IF NOT EXISTS payback "
"(reserve_pub BYTEA NOT NULL REFERENCES reserves (reserve_pub) ON DELETE CASCADE"
- ",coin_pub BYTEA NOT NULL REFERENCES known_coins (coin_pub) ON DELETE CASCADE"
+ ",coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)"
",coin_sig BYTEA NOT NULL CHECK(LENGTH(coin_sig)=64)"
",coin_blind BYTEA NOT NULL CHECK(LENGTH(coin_blind)=32)"
",amount_val INT8 NOT NULL"
@@ -1454,8 +1454,6 @@ postgres_prepare (PGconn *db_conn)
" WHERE payback.coin_pub=$1",
1, NULL);
-
-
/* Used in #postgres_get_reserve_by_h_blind() */
PREPARE ("reserve_by_h_blind",
"SELECT"
@@ -5625,7 +5623,7 @@ postgres_select_wire_out_above_serial_id (void *cls,
* @param cls closure
* @param session database connection
* @param reserve_pub public key of the reserve that is being refunded
- * @param coin information about the coin
+ * @param coin_pub public key of the coin
* @param coin_sig signature of the coin of type #TALER_SIGNATURE_WALLET_COIN_PAYBACK
* @param coin_blind blinding key of the coin
* @param amount total amount to be paid back
@@ -5639,7 +5637,7 @@ static int
postgres_insert_payback_request (void *cls,
struct TALER_EXCHANGEDB_Session *session,
const struct TALER_ReservePublicKeyP *reserve_pub,
- const struct TALER_CoinPublicInfo *coin,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_CoinSpendSignatureP *coin_sig,
const struct TALER_DenominationBlindingKeyP *coin_blind,
const struct TALER_Amount *amount,
@@ -5652,7 +5650,7 @@ postgres_insert_payback_request (void *cls,
struct TALER_EXCHANGEDB_Reserve reserve;
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (reserve_pub),
- GNUNET_PQ_query_param_auto_from_type (&coin->coin_pub),
+ GNUNET_PQ_query_param_auto_from_type (coin_pub),
GNUNET_PQ_query_param_auto_from_type (coin_sig),
GNUNET_PQ_query_param_auto_from_type (coin_blind),
TALER_PQ_query_param_amount (amount),