gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: -fix typo


From: gnunet
Subject: [taler-exchange] branch master updated: -fix typo
Date: Sun, 10 Sep 2023 20:00:54 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new e967208e -fix typo
e967208e is described below

commit e967208e8c01af28e2ebde34c8deea326f09e5e3
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Sep 10 20:00:50 2023 +0200

    -fix typo
---
 src/exchange/taler-exchange-httpd_batch-deposit.c | 15 +++++++++++----
 src/exchangedb/exchange_do_deposit.sql            |  2 +-
 src/exchangedb/pg_do_deposit.c                    |  4 ++++
 src/exchangedb/pg_get_coin_transactions.c         | 16 ++++++++--------
 4 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_batch-deposit.c 
b/src/exchange/taler-exchange-httpd_batch-deposit.c
index a5283d20..ca206d23 100644
--- a/src/exchange/taler-exchange-httpd_batch-deposit.c
+++ b/src/exchange/taler-exchange-httpd_batch-deposit.c
@@ -202,7 +202,7 @@ batch_deposit_transaction (void *cls,
   struct BatchDepositContext *dc = cls;
   const struct TALER_EXCHANGEDB_BatchDeposit *bd = &dc->bd;
   enum GNUNET_DB_QueryStatus qs = GNUNET_SYSERR;
-  uint32_t bad_balance_coin_index;
+  uint32_t bad_balance_coin_index = UINT32_MAX;
   bool balance_ok;
   bool in_conflict;
 
@@ -233,6 +233,10 @@ batch_deposit_transaction (void *cls,
                               connection,
                               &known_coin_id,
                               mhd_ret);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "make coin known (%s) returned %d\n",
+                TALER_B2S (&cdi->coin.coin_pub),
+                qs);
     if (qs < 0)
       return qs;
   }
@@ -256,11 +260,11 @@ batch_deposit_transaction (void *cls,
                                            "batch-deposit");
     return qs;
   }
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "do_deposit returned %d / %s / %u / %s\n",
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "do_deposit returned: %d / %s[%u] / %s\n",
               qs,
               balance_ok ? "balance ok" : "balance insufficient",
-              bad_balance_coin_index,
+              (unsigned int) bad_balance_coin_index,
               in_conflict ? "in conflict" : "no conflict");
   if (in_conflict)
   {
@@ -276,6 +280,9 @@ batch_deposit_transaction (void *cls,
   if (! balance_ok)
   {
     GNUNET_assert (bad_balance_coin_index < bd->num_cdis);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "returning history of conflicting coin (%s)\n",
+                TALER_B2S (&bd->cdis[bad_balance_coin_index].coin.coin_pub));
     *mhd_ret
       = TEH_RESPONSE_reply_coin_insufficient_funds (
           connection,
diff --git a/src/exchangedb/exchange_do_deposit.sql 
b/src/exchangedb/exchange_do_deposit.sql
index f2828cb5..1156c7de 100644
--- a/src/exchangedb/exchange_do_deposit.sql
+++ b/src/exchangedb/exchange_do_deposit.sql
@@ -198,7 +198,7 @@ LOOP
     THEN
       -- Insufficient balance.
       -- Note: C arrays are 0 indexed, but i started at 1
-      out_insufficient_balance_coin_index=i-i;
+      out_insufficient_balance_coin_index=i-1;
       RETURN;
     END IF;
   END IF;
diff --git a/src/exchangedb/pg_do_deposit.c b/src/exchangedb/pg_do_deposit.c
index 11720d7d..3513ba2b 100644
--- a/src/exchangedb/pg_do_deposit.c
+++ b/src/exchangedb/pg_do_deposit.c
@@ -96,6 +96,10 @@ TEH_PG_do_deposit (
     amounts_with_fee[i] = cdi->amount_with_fee;
     coin_pubs[i] = &cdi->coin.coin_pub;
     coin_sigs[i] = &cdi->csig;
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                "Do deposit %u = %s\n",
+                i,
+                TALER_B2S (&cdi->coin.coin_pub));
   }
   PREPARE (pg,
            "call_deposit",
diff --git a/src/exchangedb/pg_get_coin_transactions.c 
b/src/exchangedb/pg_get_coin_transactions.c
index c2f0f822..ad0835fd 100644
--- a/src/exchangedb/pg_get_coin_transactions.c
+++ b/src/exchangedb/pg_get_coin_transactions.c
@@ -741,14 +741,14 @@ TEH_PG_get_coin_transactions (
            ",cdep.coin_deposit_serial_id"
            ",bdep.done"
            " FROM coin_deposits cdep"
-           "    JOIN batch_deposits bdep"
-           "      USING (batch_deposit_serial_id)"
-           "    JOIN wire_targets wt"
-           "      USING (wire_target_h_payto)"
-           "    JOIN known_coins kc"
-           "      ON (kc.coin_pub = cdep.coin_pub)"
-           "    JOIN denominations denoms"
-           "      USING (denominations_serial)"
+           " JOIN batch_deposits bdep"
+           "   USING (batch_deposit_serial_id)"
+           " JOIN wire_targets wt"
+           "   USING (wire_target_h_payto)"
+           " JOIN known_coins kc"
+           "   ON (kc.coin_pub = cdep.coin_pub)"
+           " JOIN denominations denoms"
+           "   USING (denominations_serial)"
            " WHERE cdep.coin_pub=$1;");
   PREPARE (pg,
            "get_refresh_session_by_coin",

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]