exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

iterate_aggregation_wtids_above_serial_id.h (2817B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 2026 Taler Systems SA
      4 
      5    TALER is free software; you can redistribute it and/or modify it under the
      6    terms of the GNU General Public License as published by the Free Software
      7    Foundation; either version 3, or (at your option) any later version.
      8 
      9    TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     10    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11    A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     12 
     13    You should have received a copy of the GNU General Public License along with
     14    TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15  */
     16 /**
     17  * @file src/include/exchange-database/iterate_aggregation_wtids_above_serial_id.h
     18  * @brief implementation of the iterate_aggregation_wtids_above_serial_id function
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_ITERATE_AGGREGATION_WTIDS_ABOVE_SERIAL_ID_H
     22 #define EXCHANGE_DATABASE_ITERATE_AGGREGATION_WTIDS_ABOVE_SERIAL_ID_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "exchangedb_lib.h"
     26 
     27 
     28 #ifndef TALER_EXCHANGEDB_AGGREGATION_WTID_RESULT_CLOSURE
     29 /**
     30  * Type of the closure for #TALER_EXCHANGEDB_AggregationWtidCallback.
     31  */
     32 #define TALER_EXCHANGEDB_AGGREGATION_WTID_RESULT_CLOSURE void
     33 #endif
     34 
     35 
     36 /**
     37  * Function called on each row of the aggregation tracking table, telling
     38  * the caller which wire transfer the aggregated deposit was assigned to.
     39  *
     40  * Note that many rows share the same @a wtid: one wire transfer pays out
     41  * many deposits.
     42  *
     43  * @param cls closure
     44  * @param rowid row of the entry in the aggregation tracking table
     45  * @param wtid wire transfer the deposit was aggregated into
     46  * @param wire_target_h_payto account the wire transfer should go to
     47  * @param pending false if @a wtid already has its `wire_out` row, that is if
     48  *        the exchange really did make the transfer
     49  * @return #GNUNET_OK to continue to iterate
     50  */
     51 typedef enum GNUNET_GenericReturnValue
     52 (*TALER_EXCHANGEDB_AggregationWtidCallback)(
     53   TALER_EXCHANGEDB_AGGREGATION_WTID_RESULT_CLOSURE *cls,
     54   uint64_t rowid,
     55   const struct TALER_WireTransferIdentifierRawP *wtid,
     56   const struct TALER_FullPaytoHashP *wire_target_h_payto,
     57   bool pending);
     58 
     59 
     60 /**
     61  * Select all aggregations at or above @a serial_id, in ascending order.
     62  *
     63  * @param pg the database context
     64  * @param serial_id highest serial ID to exclude (select strictly larger)
     65  * @param cb function to call on each result
     66  * @param cb_cls closure for @a cb
     67  * @return query status
     68  */
     69 enum GNUNET_DB_QueryStatus
     70 TALER_EXCHANGEDB_iterate_aggregation_wtids_above_serial_id (
     71   struct TALER_EXCHANGEDB_PostgresContext *pg,
     72   uint64_t serial_id,
     73   TALER_EXCHANGEDB_AggregationWtidCallback cb,
     74   TALER_EXCHANGEDB_AGGREGATION_WTID_RESULT_CLOSURE *cb_cls);
     75 
     76 #endif