diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-08-28 15:31:52 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-08-28 15:31:52 +0200 |
commit | 2a26dcbf9d957eb1c22a74a0f9b92bba07084dec (patch) | |
tree | 81370ae604952acf5ce0c6f58de34cdb48855e9d | |
parent | e506bdd1088e1c81597f97022567adfe3bd44563 (diff) |
clean up transaction logic in helpers, bump gnunet dependency
m--------- | contrib/wallet-core | 0 | ||||
-rw-r--r-- | debian/control | 4 | ||||
-rw-r--r-- | src/auditor/taler-helper-auditor-transfer.c | 9 | ||||
-rw-r--r-- | src/auditor/taler-helper-auditor-wire-credit.c | 15 | ||||
-rw-r--r-- | src/auditor/taler-helper-auditor-wire-debit.c | 10 | ||||
-rw-r--r-- | src/benchmark/taler-exchange-benchmark.c | 6 | ||||
-rw-r--r-- | src/exchangedb/pg_commit.c | 1 |
7 files changed, 14 insertions, 31 deletions
diff --git a/contrib/wallet-core b/contrib/wallet-core -Subproject 643952825b46dabafe413945e53e0faac1c4302 +Subproject 514e64af46c8cc6b767cb3a0f56733d4fd0efc9 diff --git a/debian/control b/debian/control index 52ab79c5f..742864440 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Build-Depends: gcc-12, debhelper-compat (= 12), gettext, - libgnunet-dev (>=0.21), + libgnunet-dev (>=0.22), libcurl4-gnutls-dev (>=7.35.0) | libcurl4-openssl-dev (>= 7.35.0), libgcrypt20-dev (>=1.8), libgnutls28-dev (>=3.2.12), @@ -155,7 +155,7 @@ Section: libdevel Architecture: any Depends: libtalerexchange (= ${binary:Version}), - libgnunet-dev (>=0.21), + libgnunet-dev (>=0.22), libgcrypt20-dev (>=1.8), libmicrohttpd-dev (>=0.9.71), ${misc:Depends}, diff --git a/src/auditor/taler-helper-auditor-transfer.c b/src/auditor/taler-helper-auditor-transfer.c index dd8cca566..f4cd4a088 100644 --- a/src/auditor/taler-helper-auditor-transfer.c +++ b/src/auditor/taler-helper-auditor-transfer.c @@ -294,10 +294,9 @@ begin_transaction (void) GNUNET_break (0); return GNUNET_DB_STATUS_HARD_ERROR; } - TALER_ARL_edb->preflight (TALER_ARL_edb->cls); if (GNUNET_OK != - TALER_ARL_edb->start (TALER_ARL_edb->cls, - "transfer auditor")) + TALER_ARL_edb->start_read_only (TALER_ARL_edb->cls, + "transfer auditor")) { GNUNET_break (0); TALER_ARL_adb->rollback (TALER_ARL_adb->cls); @@ -347,9 +346,7 @@ begin_transaction (void) "Concluded audit step at %llu/%llu\n", (unsigned long long) TALER_ARL_USE_PP (wire_aggregation_id), (unsigned long long) TALER_ARL_USE_PP (wire_batch_deposit_id)); - qs = TALER_ARL_edb->commit (TALER_ARL_edb->cls); - if (0 > qs) - goto handle_db_error; + TALER_ARL_edb->rollback (TALER_ARL_edb->cls); qs = TALER_ARL_adb->commit (TALER_ARL_adb->cls); if (0 > qs) goto handle_db_error; diff --git a/src/auditor/taler-helper-auditor-wire-credit.c b/src/auditor/taler-helper-auditor-wire-credit.c index ecded264a..afdae8b37 100644 --- a/src/auditor/taler-helper-auditor-wire-credit.c +++ b/src/auditor/taler-helper-auditor-wire-credit.c @@ -332,6 +332,7 @@ commit (enum GNUNET_DB_QueryStatus qs) GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Transaction logic ended with status %d\n", qs); + TALER_ARL_edb->rollback (TALER_ARL_edb->cls); if (qs < 0) goto handle_db_error; qs = TALER_ARL_adb->update_balance ( @@ -380,14 +381,6 @@ commit (enum GNUNET_DB_QueryStatus qs) (unsigned long long) wa->last_reserve_in_serial_id, wa->ai->section_name); } - qs = TALER_ARL_edb->commit (TALER_ARL_edb->cls); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Exchange DB commit failed, rolling back transaction\n"); - goto handle_db_error; - } qs = TALER_ARL_adb->commit (TALER_ARL_adb->cls); if (0 > qs) { @@ -401,7 +394,6 @@ commit (enum GNUNET_DB_QueryStatus qs) return; handle_db_error: TALER_ARL_adb->rollback (TALER_ARL_adb->cls); - TALER_ARL_edb->rollback (TALER_ARL_edb->cls); for (unsigned int max_retries = 3; max_retries>0; max_retries--) { if (GNUNET_DB_STATUS_HARD_ERROR == qs) @@ -960,10 +952,9 @@ begin_transaction (void) GNUNET_break (0); return GNUNET_DB_STATUS_HARD_ERROR; } - TALER_ARL_edb->preflight (TALER_ARL_edb->cls); if (GNUNET_OK != - TALER_ARL_edb->start (TALER_ARL_edb->cls, - "wire credit auditor")) + TALER_ARL_edb->start_read_only (TALER_ARL_edb->cls, + "wire credit auditor")) { GNUNET_break (0); return GNUNET_DB_STATUS_HARD_ERROR; diff --git a/src/auditor/taler-helper-auditor-wire-debit.c b/src/auditor/taler-helper-auditor-wire-debit.c index 15da0784f..d0ec07745 100644 --- a/src/auditor/taler-helper-auditor-wire-debit.c +++ b/src/auditor/taler-helper-auditor-wire-debit.c @@ -527,6 +527,7 @@ commit (enum GNUNET_DB_QueryStatus qs) GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Transaction logic ended with status %d\n", qs); + qs = TALER_ARL_edb->rollback (TALER_ARL_edb->cls); if (qs < 0) goto handle_db_error; qs = TALER_ARL_adb->update_balance ( @@ -606,9 +607,6 @@ commit (enum GNUNET_DB_QueryStatus qs) GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Concluded audit step at %llu\n", (unsigned long long) TALER_ARL_USE_PP (wire_reserve_close_id)); - qs = TALER_ARL_edb->commit (TALER_ARL_edb->cls); - if (0 > qs) - goto handle_db_error; qs = TALER_ARL_adb->commit (TALER_ARL_adb->cls); if (0 > qs) goto handle_db_error; @@ -619,7 +617,6 @@ commit (enum GNUNET_DB_QueryStatus qs) return; handle_db_error: TALER_ARL_adb->rollback (TALER_ARL_adb->cls); - TALER_ARL_edb->rollback (TALER_ARL_edb->cls); for (unsigned int max_retries = 3; max_retries>0; max_retries--) { if (GNUNET_DB_STATUS_HARD_ERROR == qs) @@ -1594,10 +1591,9 @@ begin_transaction (void) GNUNET_break (0); return GNUNET_DB_STATUS_HARD_ERROR; } - TALER_ARL_edb->preflight (TALER_ARL_edb->cls); if (GNUNET_OK != - TALER_ARL_edb->start (TALER_ARL_edb->cls, - "wire auditor")) + TALER_ARL_edb->start_read_only (TALER_ARL_edb->cls, + "wire debit auditor")) { GNUNET_break (0); return GNUNET_DB_STATUS_HARD_ERROR; diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c index 75424a358..db1fadd1f 100644 --- a/src/benchmark/taler-exchange-benchmark.c +++ b/src/benchmark/taler-exchange-benchmark.c @@ -144,7 +144,7 @@ static struct TALER_TESTING_Timer timings[] = { * @param label string to add to the table * @return same string, now stored in the table */ -const char * +static const char * add_label (char *label) { if (label_off == label_len) @@ -296,7 +296,7 @@ run (void *cls, GNUNET_TIME_UNIT_ZERO, amount_1, MHD_HTTP_OK)); - if (eval_probability (refresh_rate / 100.0)) + if (eval_probability (refresh_rate / 100.0d)) { char *melt_label; char *reveal_label; @@ -630,7 +630,7 @@ main (int argc, " * Reserve=%u * Parallel=%u, operations in %s\n", howmany_coins, howmany_coins, - (float) howmany_coins * (refresh_rate / 100.0), + howmany_coins * (refresh_rate / 100.0d), howmany_reserves, howmany_clients, GNUNET_STRINGS_relative_time_to_string ( diff --git a/src/exchangedb/pg_commit.c b/src/exchangedb/pg_commit.c index 66adfd79b..1ecbdb410 100644 --- a/src/exchangedb/pg_commit.c +++ b/src/exchangedb/pg_commit.c @@ -48,7 +48,6 @@ TEH_PG_commit (void *cls) PREPARE (pg, "do_commit", "COMMIT"); - qs = GNUNET_PQ_eval_prepared_non_select (pg->conn, "do_commit", params); |