merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit ab8e426cae07d43ec7862c9ea9cc4279902bde8b
parent d7b1ca64b10c51dd2e52d452d19ac416fdb2d2b3
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon,  1 Apr 2024 20:34:50 +0200

return error code from taler-merchant-exchange if ever any transaction had an issue

Diffstat:
Msrc/backend/taler-merchant-exchange.c | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/backend/taler-merchant-exchange.c b/src/backend/taler-merchant-exchange.c @@ -238,6 +238,11 @@ static struct GNUNET_DB_EventHandler *eh; static unsigned int active_inquiries; /** + * Set to true if we ever encountered any problem. + */ +static bool found_problem; + +/** * Value to return from main(). 0 on success, non-zero on errors. */ static int global_ret; @@ -394,6 +399,8 @@ update_transaction_status (const struct Inquiry *w, { enum GNUNET_DB_QueryStatus qs; + if (failed) + found_problem = true; qs = db_plugin->update_transfer_status (db_plugin->cls, w->exchange->exchange_url, &w->wtid, @@ -1273,6 +1280,9 @@ main (int argc, return EXIT_INVALIDARGUMENT; if (GNUNET_NO == ret) return EXIT_SUCCESS; + if ( (found_problem) && + (0 == global_ret) ) + global_ret = 7; return global_ret; }