gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated (3317dad7 -> bed08b39)


From: gnunet
Subject: [taler-exchange] branch master updated (3317dad7 -> bed08b39)
Date: Fri, 03 Sep 2021 09:51:21 +0200

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

grothoff pushed a change to branch master
in repository exchange.

    from 3317dad7 fix gana path
     new 6ab130d9 -wip
     new fab91404 -nicer return value
     new bed08b39 -code cleanup

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/exchange/taler-exchange-aggregator.c | 25 ++++-------
 src/exchangedb/exchange-0003.sql         | 72 --------------------------------
 2 files changed, 9 insertions(+), 88 deletions(-)
 delete mode 100644 src/exchangedb/exchange-0003.sql

diff --git a/src/exchange/taler-exchange-aggregator.c 
b/src/exchange/taler-exchange-aggregator.c
index c82b6666..6602f3be 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -100,15 +100,10 @@ struct AggregationUnit
   unsigned int rows_offset;
 
   /**
-   * Set to #GNUNET_YES if we have to abort due to failure.
-   */
-  int failed;
-
-  /**
-   * Set to #GNUNET_YES if we encountered a refund during #refund_by_coin_cb.
+   * Set to true if we encountered a refund during #refund_by_coin_cb.
    * Used to wave the deposit fee.
    */
-  int have_refund;
+  bool have_refund;
 };
 
 
@@ -211,7 +206,7 @@ shutdown_task (void *cls)
  *
  * @return #GNUNET_OK on success
  */
-static int
+static enum GNUNET_GenericReturnValue
 parse_wirewatch_config (void)
 {
   if (GNUNET_OK !=
@@ -288,7 +283,7 @@ refund_by_coin_cb (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Aggregator subtracts applicable refund of amount %s\n",
               TALER_amount2s (amount_with_fee));
-  aux->have_refund = GNUNET_YES;
+  aux->have_refund = true;
   if (0 >
       TALER_amount_subtract (&aux->total_amount,
                              &aux->total_amount,
@@ -335,7 +330,6 @@ deposit_cb (void *cls,
   struct AggregationUnit *au = cls;
   enum GNUNET_DB_QueryStatus qs;
 
-  (void) cls;
   /* NOTE: potential optimization: use custom SQL API to not
      fetch this one: */
   (void) wire_deadline; /* already checked by SQL query */
@@ -348,7 +342,7 @@ deposit_cb (void *cls,
               TALER_amount2s (amount_with_fee));
   au->row_id = row_id;
   au->total_amount = *amount_with_fee;
-  au->have_refund = GNUNET_NO;
+  au->have_refund = false;
   qs = db_plugin->select_refunds_by_coin (db_plugin->cls,
                                           coin_pub,
                                           &au->merchant_pub,
@@ -360,7 +354,7 @@ deposit_cb (void *cls,
     GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
     return qs;
   }
-  if (GNUNET_NO == au->have_refund)
+  if (! au->have_refund)
   {
     struct TALER_Amount ntotal;
 
@@ -524,7 +518,7 @@ aggregate_cb (void *cls,
   /* we begin with the total contribution of the current coin */
   au->total_amount = *amount_with_fee;
   /* compute contribution of this coin (after fees) */
-  au->have_refund = GNUNET_NO;
+  au->have_refund = false;
   qs = db_plugin->select_refunds_by_coin (db_plugin->cls,
                                           coin_pub,
                                           &au->merchant_pub,
@@ -536,7 +530,7 @@ aggregate_cb (void *cls,
     GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
     return qs;
   }
-  if (GNUNET_NO == au->have_refund)
+  if (! au->have_refund)
   {
     struct TALER_Amount tmp;
 
@@ -716,8 +710,7 @@ run_aggregation (void *cls)
                                              &aggregate_cb,
                                              &au_active,
                                              
TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT);
-  if ( (GNUNET_DB_STATUS_HARD_ERROR == qs) ||
-       (GNUNET_YES == au_active.failed) )
+  if (GNUNET_DB_STATUS_HARD_ERROR == qs)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Failed to execute deposit iteration!\n");
diff --git a/src/exchangedb/exchange-0003.sql b/src/exchangedb/exchange-0003.sql
deleted file mode 100644
index 387746e5..00000000
--- a/src/exchangedb/exchange-0003.sql
+++ /dev/null
@@ -1,72 +0,0 @@
---
--- This file is part of TALER
--- Copyright (C) 2021 Taler Systems SA
---
--- TALER is free software; you can redistribute it and/or modify it under the
--- terms of the GNU General Public License as published by the Free Software
--- Foundation; either version 3, or (at your option) any later version.
---
--- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
--- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
--- A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License along with
--- TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
---
-
--- Everything in one big transaction
-BEGIN;
-
--- Check patch versioning is in place.
-SELECT _v.register_patch('exchange-0003', NULL, NULL);
-
-
-CREATE TABLE IF NOT EXISTS aggregation_wip
-  (aggregation_wip_serial BIGSERIAL UNIQUE
-  ,wtid_raw BYTEA UNIQUE CHECK (LENGTH(wtid_raw)=32)
-  ,wire_target TEXT NOT NULL
-  ,exchange_account_section TEXT NOT NULL
-  ,execution_date INT8 NOT NULL
-  ,PRIMARY KEY (wire_target,execution_date));
-
-COMMENT ON TABLE aggregation_wip
-  IS 'Table tracking aggregations that are work in progress, allowing 
aggregation work to be divided up between multiple workers. Entries are created 
when a worker decides that a job is too big for a single worker/transaction and 
thus should be sharded. They are deleted once the work has concluded, that is a 
wire_out entry has been created from the final aggregation level.';
-COMMENT ON COLUMN aggregation_wip.wtid_raw
-  IS 'wire transfer identifier to be used';
-COMMENT ON COLUMN aggregation_wip.wire_target
-  IS 'identifies the credit account of the aggregated payment';
-COMMENT ON COLUMN aggregation_wip.execution_date
-  IS 'time when the payment was triggered (is due)';
-COMMENT ON COLUMN aggregation_wip.exchange_account_section
-  IS 'identifies the configuration section with the debit account of this 
payment';
-
-
-CREATE TABLE IF NOT EXISTS aggregation_tree
-  (aggregation_wip_uuid INT8 REFERENCES aggregation_wip 
(aggregation_wip_serial) ON DELETE CASCADE
-  ,amount_val INT8 NOT NULL DEFAULT 0
-  ,amount_frac INT4 NOT NULL DEFAULT 0
-  ,shard_offset INT8 NOT NULL
-  ,shard_end INT8 NOT NULL
-  ,shard_level INT4 NOT NULL
-  ,aggregated BOOLEAN NOT NULL DEFAULT false
-  ,summed BOOLEAN NOT NULL DEFAULT false
-  ,PRIMARY KEY (aggregation_wip_uuid,shard_offset,shard_level)
-  );
-COMMENT ON TABLE aggregation_tree
-  IS 'Entry in the B-tree for tracking aggregations that are work in progress. 
Entries are created when aggregation work is to be done on the level below. The 
exception is level 0, here each worker that performs a successful SELECT on its 
locked entry must create a speculative subsequent entry past the SELECTed 
range. Once the aggregation at for one entry is done, aggregated is set to 
true. Once an entry is itself aggregated into the level above, summed is set to 
true. Once the entire tr [...]
-COMMENT ON COLUMN aggregation_tree.amount_val
-  IS 'identifies the amount aggregated so far';
-COMMENT ON COLUMN aggregation_tree.shard_offset
-  IS 'starting offset of this aggregation entry (inclusive) in relation to the 
level below; at level 0, this refers to the offset in the deposits query';
-COMMENT ON COLUMN aggregation_tree.shard_end
-  IS 'end offset of this aggregation entry (exclusive)';
-COMMENT ON COLUMN aggregation_tree.shard_level
-  IS 'depth of the aggregation tree for this entry; work on a given level can 
only start if the level below has finished';
-COMMENT ON COLUMN aggregation_tree.aggregated
-  IS 'true once this transactions corresponding to this range have been added 
up into the amount_val (when false, amount_val is 0 and this column represents 
work that remains to be done)';
-COMMENT ON COLUMN aggregation_tree.summed
-  IS 'true once this entry has been aggregated into a higher-level entry';
-
-
--- Complete transaction
-COMMIT;

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