commit 8b06a199549d4478156998a0c6cfa4f3892f6220
parent 3acaf80c3b2f388d07a9d8c00bf432e253c0fae1
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 11 Oct 2026 14:38:39 +0200
MAXIMUM_BATCH_SIZE is a hard limit, enforce cap on command-line
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c
@@ -204,9 +204,10 @@ static struct GNUNET_TIME_Relative wirewatch_idle_sleep_interval;
static struct GNUNET_TIME_Relative wirewatch_conflict_sleep_interval;
/**
- * Modulus to apply to group shards. The shard size must ultimately be a
+ * Modulus to apply to group shards. The shard size should ultimately be a
* multiple of the batch size. Thus, if this is not a multiple of the
- * #MAXIMUM_BATCH_SIZE, the batch size will be set to the #shard_size.
+ * #MAXIMUM_BATCH_SIZE, the batch size will be set to the #shard_size,
+ * but never above #MAXIMUM_BATCH_SIZE.
*/
static unsigned int shard_size = MAXIMUM_BATCH_SIZE;
@@ -335,7 +336,8 @@ add_account_cb (void *cls,
ai->section_name);
batch_size = MAXIMUM_BATCH_SIZE;
if (0 != shard_size % batch_size)
- batch_size = shard_size;
+ batch_size = GNUNET_MIN (shard_size,
+ MAXIMUM_BATCH_SIZE);
}