gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch stable updated (111f8f2 -> 48fd50f)


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch stable updated (111f8f2 -> 48fd50f)
Date: Tue, 06 Feb 2018 00:36:27 +0100

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

dold pushed a change to branch stable
in repository exchange.

    from 111f8f2  url joining: grow strings correctly
     add b6b7a36  wirewatch: fix uninitialized offset variable, logging
     add f8d7c1e  wirewatch: no need to do rollback on hard/soft error
     add 48fd50f  exchangedb/postgres: handle duplicate wire transfers correctly

No new revisions were added by this update.

Summary of changes:
 src/exchange/taler-exchange-wirewatch.c     | 13 +++++++------
 src/exchangedb/plugin_exchangedb_postgres.c |  8 ++++----
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/exchange/taler-exchange-wirewatch.c 
b/src/exchange/taler-exchange-wirewatch.c
index e45b424..f28c800 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -306,6 +306,9 @@ history_cb (void *cls,
   enum GNUNET_DB_QueryStatus qs;
   struct TALER_ReservePublicKeyP reserve_pub;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Got history callback, direction %u!\n", (unsigned int) dir);
+
   if (TALER_BANK_DIRECTION_NONE == dir)
   {
     hh = NULL;
@@ -353,6 +356,7 @@ history_cb (void *cls,
     {
       GNUNET_free_non_null (last_row_off);
       last_row_off = GNUNET_malloc (row_off_size);
+      last_row_off_size = row_off_size;
     }
     memcpy (last_row_off,
             row_off,
@@ -388,15 +392,13 @@ history_cb (void *cls,
   if (GNUNET_DB_STATUS_HARD_ERROR == qs)
   {
     GNUNET_break (0);
-    db_plugin->rollback (db_plugin->cls,
-                        session);
     GNUNET_SCHEDULER_shutdown ();
     return GNUNET_SYSERR;
   }
   if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
   {
-    db_plugin->rollback (db_plugin->cls,
-                         session);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Got DB soft error for reserve_in_insert\n");
     /* try again */
     task = GNUNET_SCHEDULER_add_now (&find_transfers,
                                     NULL);
@@ -465,13 +467,12 @@ find_transfers (void *cls)
     if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
     {
       /* try again */
-      db_plugin->rollback (db_plugin->cls,
-                           session);
       task = GNUNET_SCHEDULER_add_now (&find_transfers,
                                        NULL);
       return;
     }
   }
+  GNUNET_assert ((NULL == start_off) || ((NULL != start_off) && 
(start_off_size != 0)));
   delay = GNUNET_YES;
   hh = wire_plugin->get_history (wire_plugin->cls,
                                 TALER_BANK_DIRECTION_CREDIT,
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c 
b/src/exchangedb/plugin_exchangedb_postgres.c
index a9d5db7..a4f32cd 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -583,7 +583,8 @@ postgres_prepare (PGconn *db_conn)
                             ",sender_account_details"
                             ",execution_date"
                             ") VALUES "
-                            "($1, $2, $3, $4, $5, $6, $7);",
+                            "($1, $2, $3, $4, $5, $6, $7) "
+                            "ON CONFLICT DO NOTHING;",
                             7),
     /* Used in postgres_select_reserves_in_above_serial_id() to obtain inbound
        transactions for reserves with serial id '\geq' the given parameter */
@@ -1870,9 +1871,8 @@ postgres_reserves_in_insert (void *cls,
       return GNUNET_DB_STATUS_SOFT_ERROR;
     }
   }
-  /* Create new incoming transaction, SQL "primary key" logic
-     is used to guard against duplicates.  If a duplicate is
-     detected, we just "succeed" with no changes. */
+  /* Create new incoming transaction, "ON CONFLICT DO NOTHING"
+     is used to guard against duplicates. */
   {
     struct GNUNET_PQ_QueryParam params[] = {
       GNUNET_PQ_query_param_auto_from_type (&reserve.pub),

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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