gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: anti-gummy patch


From: gnunet
Subject: [taler-exchange] branch master updated: anti-gummy patch
Date: Fri, 20 May 2022 16:49: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 421f5974 anti-gummy patch
421f5974 is described below

commit 421f59749ec806a59bb2078c4f5c4dc0d52032dd
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri May 20 16:49:48 2022 +0200

    anti-gummy patch
---
 src/exchange/taler-exchange-wirewatch.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/exchange/taler-exchange-wirewatch.c 
b/src/exchange/taler-exchange-wirewatch.c
index 58c8f82a..8e453830 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -1,6 +1,6 @@
 /*
   This file is part of TALER
-  Copyright (C) 2016--2021 Taler Systems SA
+  Copyright (C) 2016--2022 Taler Systems SA
 
   TALER is free software; you can redistribute it and/or modify it under the
   terms of the GNU Affero General Public License as published by the Free 
Software
@@ -84,6 +84,13 @@ struct WireAccount
    */
   uint64_t latest_row_off;
 
+  /**
+   * Maximum row offset this transaction may yield. If we got the
+   * maximum number of rows, we must not @e delay before running
+   * the next transaction.
+   */
+  uint64_t max_row_off;
+
   /**
    * Offset where our current shard begins (inclusive).
    */
@@ -585,6 +592,8 @@ history_cb (void *cls,
     wa->hh = NULL;
     return GNUNET_SYSERR;
   }
+  if (serial_id >= wa->max_row_off)
+    wa->delay = false;
   if (serial_id > wa->shard_end)
   {
     /* we are done with the current shard, commit and stop this iteration! */
@@ -593,7 +602,6 @@ history_cb (void *cls,
                 (unsigned long long) serial_id,
                 (unsigned long long) wa->shard_end);
     wa->latest_row_off = serial_id - 1;
-    wa->delay = false;
     if (wa->started_transaction)
     {
       do_commit (wa);
@@ -660,7 +668,6 @@ history_cb (void *cls,
     /* normal case */
     break;
   }
-  wa->delay = false;
   wa->latest_row_off = serial_id;
   return GNUNET_OK;
 }
@@ -760,6 +767,7 @@ find_transfers (void *cls)
                       wa_pos->shard_end - wa_pos->batch_start);
   GNUNET_assert (NULL == wa_pos->hh);
   wa_pos->latest_row_off = wa_pos->batch_start;
+  wa_pos->max_row_off = wa_pos->batch_start + limit - 1;
   wa_pos->hh = TALER_BANK_credit_history (ctx,
                                           wa_pos->ai->auth,
                                           wa_pos->batch_start,

-- 
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]