aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-05-20 16:49:48 +0200
committerChristian Grothoff <christian@grothoff.org>2022-05-20 16:49:48 +0200
commit421f59749ec806a59bb2078c4f5c4dc0d52032dd (patch)
tree9119b46318135ec4272f88d22e0e53d2f79d8289
parent68b155aab5b7eeb909314007cd23bc5a551aa9b5 (diff)
anti-gummy patch
-rw-r--r--src/exchange/taler-exchange-wirewatch.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c
index 58c8f82a5..8e4538300 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
@@ -85,6 +85,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).
*/
uint64_t shard_start;
@@ -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,