aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/irbt_callbacks.c2
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c43
-rw-r--r--src/exchangedb/test_exchangedb.c23
3 files changed, 23 insertions, 45 deletions
diff --git a/src/exchangedb/irbt_callbacks.c b/src/exchangedb/irbt_callbacks.c
index e725ad2c7..ffad1c9b0 100644
--- a/src/exchangedb/irbt_callbacks.c
+++ b/src/exchangedb/irbt_callbacks.c
@@ -266,7 +266,7 @@ irbt_cb_table_auditors (struct PostgresClosure *pg,
GNUNET_PQ_query_param_auto_from_type (&td->details.auditors.auditor_pub),
GNUNET_PQ_query_param_string (td->details.auditors.auditor_name),
GNUNET_PQ_query_param_string (td->details.auditors.auditor_url),
- GNUNET_PQ_query_param_bool (&td->details.auditors.is_active),
+ GNUNET_PQ_query_param_bool (td->details.auditors.is_active),
GNUNET_PQ_query_param_timestamp (&td->details.auditors.last_change),
GNUNET_PQ_query_param_end
};
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index 5fb797978..505f493e5 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -2544,24 +2544,6 @@ prepare_statements (struct PostgresClosure *pg)
/* Used in #postgres_get_expired_reserves() */
GNUNET_PQ_make_prepare (
"get_expired_reserves",
- /*
- "SELECT"
- " expiration_date"
- ",payto_uri AS account_details"
- ",reserve_pub"
- ",current_balance_val"
- ",current_balance_frac"
- " FROM reserves"
- " JOIN reserves_in ri"
- " USING (reserve_pub)"
- " JOIN wire_targets wt"
- " ON (ri.wire_source_h_payto = wt.wire_target_h_payto)"
- " WHERE expiration_date<=$1"
- " AND (current_balance_val != 0 "
- " OR current_balance_frac != 0)"
- " ORDER BY expiration_date ASC"
- " LIMIT 1;",
- */
"WITH ed AS MATERIALIZED ( "
" SELECT * "
" FROM reserves "
@@ -4082,18 +4064,6 @@ prepare_statements (struct PostgresClosure *pg)
") VALUES "
"($1, $2, $3, $4, $5, $6, $7);",
7),
- // FIXME: dead!
- GNUNET_PQ_make_prepare (
- "insert_into_table_account_merges",
- "INSERT INTO account_merges"
- "(account_merge_request_serial_id"
- ",reserve_pub"
- ",reserve_sig"
- ",purse_pub"
- ",wallet_h_payto"
- ") VALUES "
- "($1, $2, $3, $4, $5);",
- 5),
GNUNET_PQ_make_prepare (
"insert_into_table_history_requests",
"INSERT INTO history_requests"
@@ -10210,7 +10180,6 @@ reserve_expired_cb (void *cls,
ret = GNUNET_SYSERR;
break;
}
- // FIXME: ret here is a qs! Bad enum conversion! FIX DESIGN!!!
ret = erc->rec (erc->rec_cls,
&reserve_pub,
&remaining_balance,
@@ -10258,8 +10227,15 @@ postgres_get_expired_reserves (void *cls,
params,
&reserve_expired_cb,
&ectx);
- if (GNUNET_OK != ectx.status)
+ switch (ectx.status)
+ {
+ case GNUNET_SYSERR:
return GNUNET_DB_STATUS_HARD_ERROR;
+ case GNUNET_NO:
+ return GNUNET_DB_STATUS_SOFT_ERROR;
+ case GNUNET_OK:
+ break;
+ }
return qs;
}
@@ -15291,7 +15267,7 @@ postgres_release_revolving_shard (void *cls,
* @param cls the @e cls of this struct with the plugin-specific state
* @return transaction status code
*/
-enum GNUNET_DB_QueryStatus
+enum GNUNET_GenericReturnValue
postgres_delete_shard_locks (void *cls)
{
struct PostgresClosure *pg = cls;
@@ -15301,7 +15277,6 @@ postgres_delete_shard_locks (void *cls)
GNUNET_PQ_EXECUTE_STATEMENT_END
};
- // FIXME: rval is a GNUNET_GenericReturnValue, not DB status!
return GNUNET_PQ_exec_statements (pg->conn,
es);
}
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c
index 366779230..1d14c7d52 100644
--- a/src/exchangedb/test_exchangedb.c
+++ b/src/exchangedb/test_exchangedb.c
@@ -445,16 +445,16 @@ static unsigned int auditor_row_cnt;
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/
static enum GNUNET_GenericReturnValue
-audit_refresh_session_cb (void *cls,
- uint64_t rowid,
- const struct TALER_DenominationPublicKey *denom_pub,
- const struct
- TALER_AgeCommitmentHash *h_age_commitment,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- const struct TALER_CoinSpendSignatureP *coin_sig,
- const struct TALER_Amount *amount_with_fee,
- uint32_t noreveal_index,
- const struct TALER_RefreshCommitmentP *rc)
+audit_refresh_session_cb (
+ void *cls,
+ uint64_t rowid,
+ const struct TALER_DenominationPublicKey *denom_pub,
+ const struct TALER_AgeCommitmentHash *h_age_commitment,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_CoinSpendSignatureP *coin_sig,
+ const struct TALER_Amount *amount_with_fee,
+ uint32_t noreveal_index,
+ const struct TALER_RefreshCommitmentP *rc)
{
(void) cls;
(void) rowid;
@@ -464,6 +464,7 @@ audit_refresh_session_cb (void *cls,
(void) amount_with_fee;
(void) noreveal_index;
(void) rc;
+ (void) h_age_commitment;
auditor_row_cnt++;
return GNUNET_OK;
}
@@ -535,6 +536,7 @@ cb_wt_never (void *cls,
(void) serial_id;
(void) merchant_pub;
(void) account_payto_uri;
+ (void) h_payto;
(void) exec_time;
(void) h_contract_terms;
(void) denom_pub;
@@ -574,6 +576,7 @@ cb_wt_check (void *cls,
{
(void) rowid;
(void) denom_pub;
+ (void) h_payto;
GNUNET_assert (cls == &cb_wt_never);
GNUNET_assert (0 == GNUNET_memcmp (merchant_pub,
&merchant_pub_wt));