exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 287aaf75cb0263ff80532e6f761a82376aa83d03
parent bb1266e3840b470296fb4e4780163a51c62f837e
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Sun, 16 Aug 2026 22:21:11 +0200

properly end/rollback transaction when finished by etag

Diffstat:
Msrc/exchangedb/get_coin_transactions.c | 5+++++
Msrc/exchangedb/get_reserve_history.c | 8++++++++
2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/exchangedb/get_coin_transactions.c b/src/exchangedb/get_coin_transactions.c @@ -1127,7 +1127,12 @@ TALER_EXCHANGEDB_get_coin_transactions ( case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: *etag_out = end; if (end == etag_in) + { + /* client is up-to-date, nothing more to do */ + if (begin_transaction) + TALER_EXCHANGEDB_rollback (pg); return qs; + } } /* We indeed need to iterate over the history */ GNUNET_log (GNUNET_ERROR_TYPE_INFO, diff --git a/src/exchangedb/get_reserve_history.c b/src/exchangedb/get_reserve_history.c @@ -901,7 +901,15 @@ TALER_EXCHANGEDB_get_reserve_history ( case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: *etag_out = end; if (end == etag_in) + { + /* Nothing changed since the client last asked, so we are done -- + but the read-committed transaction opened above still has to be + closed. Leaving it open parks the connection in "idle in + transaction" until the next TALER_EXCHANGEDB_start(), whose + preflight then rolls it back and logs it as a bug. */ + TALER_EXCHANGEDB_rollback (pg); return qs; + } } /* We indeed need to iterate over the history */ GNUNET_log (GNUNET_ERROR_TYPE_INFO,