diff options
author | Nic Eigel <nic@eigel.ch> | 2024-01-16 22:37:31 +0100 |
---|---|---|
committer | Nic Eigel <nic@eigel.ch> | 2024-01-16 22:37:31 +0100 |
commit | b5de0afa73c0b8f7bcf988e2bc00f07f4f6cf42e (patch) | |
tree | d0f7e4f65205a31db3de0b12b42e98991aefa079 /src/exchangedb | |
parent | 45b110edb2b4fd39c56f433c5c0a7f93cd29d4da (diff) | |
parent | ec522a445a2a00e9000c937e61940c7ac9c4b79d (diff) |
Merge branch 'master' of git+ssh://git.taler.net/exchange
Diffstat (limited to 'src/exchangedb')
-rw-r--r-- | src/exchangedb/plugin_exchangedb_postgres.c | 48 | ||||
-rw-r--r-- | src/exchangedb/test_exchangedb.c | 20 |
2 files changed, 38 insertions, 30 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 4e7bccbd2..b21e5d62f 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -234,14 +234,14 @@ * @param conn SQL connection that was used */ #define BREAK_DB_ERR(result,conn) do { \ - GNUNET_break (0); \ - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \ - "Database failure: %s/%s/%s/%s/%s", \ - PQresultErrorField (result, PG_DIAG_MESSAGE_PRIMARY), \ - PQresultErrorField (result, PG_DIAG_MESSAGE_DETAIL), \ - PQresultErrorMessage (result), \ - PQresStatus (PQresultStatus (result)), \ - PQerrorMessage (conn)); \ + GNUNET_break (0); \ + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \ + "Database failure: %s/%s/%s/%s/%s", \ + PQresultErrorField (result, PG_DIAG_MESSAGE_PRIMARY), \ + PQresultErrorField (result, PG_DIAG_MESSAGE_DETAIL), \ + PQresultErrorMessage (result), \ + PQresStatus (PQresultStatus (result)), \ + PQerrorMessage (conn)); \ } while (0) @@ -345,21 +345,29 @@ libtaler_plugin_exchangedb_postgres_init (void *cls) GNUNET_free (pg); return NULL; } - if ( (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_time (cfg, - "exchangedb", - "IDLE_RESERVE_EXPIRATION_TIME", - &pg->idle_reserve_expiration_time)) - || - (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_time (cfg, - "exchangedb", - "LEGAL_RESERVE_EXPIRATION_TIME", - &pg->legal_reserve_expiration_time)) ) + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_time (cfg, + "exchangedb", + "IDLE_RESERVE_EXPIRATION_TIME", + &pg->idle_reserve_expiration_time)) + { + GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, + "exchangedb", + "IDLE_RESERVE_EXPIRATION_TIME"); + GNUNET_free (pg->exchange_url); + GNUNET_free (pg->sql_dir); + GNUNET_free (pg); + return NULL; + } + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_time (cfg, + "exchangedb", + "LEGAL_RESERVE_EXPIRATION_TIME", + &pg->legal_reserve_expiration_time)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchangedb", - "LEGAL/IDLE_RESERVE_EXPIRATION_TIME"); + "LEGAL_RESERVE_EXPIRATION_TIME"); GNUNET_free (pg->exchange_url); GNUNET_free (pg->sql_dir); GNUNET_free (pg); diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c index f96e81da7..d333a7ea0 100644 --- a/src/exchangedb/test_exchangedb.c +++ b/src/exchangedb/test_exchangedb.c @@ -34,25 +34,25 @@ static int result; * Report line of error if @a cond is true, and jump to label "drop". */ #define FAILIF(cond) \ - do { \ - if (! (cond)) { break;} \ - GNUNET_break (0); \ - goto drop; \ - } while (0) + do { \ + if (! (cond)) { break;} \ + GNUNET_break (0); \ + goto drop; \ + } while (0) /** * Initializes @a ptr with random data. */ #define RND_BLK(ptr) \ - GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, ptr, \ - sizeof (*ptr)) + GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, ptr, \ + sizeof (*ptr)) /** * Initializes @a ptr with zeros. */ #define ZR_BLK(ptr) \ - memset (ptr, 0, sizeof (*ptr)) + memset (ptr, 0, sizeof (*ptr)) /** @@ -1680,8 +1680,8 @@ run (void *cls) rsa->blinded_msg_size); TALER_denom_pub_hash (&new_dkp[cnt]->pub, &ccoin->h_denom_pub); - TALER_denom_ewv_deep_copy (&ccoin->exchange_vals, - alg_values); + TALER_denom_ewv_copy (&ccoin->exchange_vals, + alg_values); TALER_coin_ev_hash (bp, &ccoin->h_denom_pub, &ccoin->coin_envelope_hash); |