aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_handle.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-03-20 13:20:45 +0100
committerChristian Grothoff <grothoff@gnunet.org>2022-03-20 13:20:45 +0100
commit427417b8352c2036dc6f5c0ca6bd20c0b7edd225 (patch)
tree54b96b474e9af87586e12763333b04257849798a /src/lib/exchange_api_handle.c
parentdee45bf02284716d5dea18e94193d74e64f7e5bf (diff)
downloadexchange-427417b8352c2036dc6f5c0ca6bd20c0b7edd225.tar.xz
towards support for new reserve history/status APIs
Diffstat (limited to 'src/lib/exchange_api_handle.c')
-rw-r--r--src/lib/exchange_api_handle.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index f7e877913..e0fcd2b93 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -2181,6 +2181,27 @@ TALER_EXCHANGE_get_denomination_key (
}
+const struct TALER_EXCHANGE_GlobalFee *
+TALER_EXCHANGE_get_global_fee (
+ const struct TALER_EXCHANGE_Keys *keys,
+ struct GNUNET_TIME_Timestamp ts)
+{
+ for (unsigned int i = 0; i<keys->num_global_fees; i++)
+ {
+ const struct TALER_EXCHANGE_GlobalFee *gf = &keys->global_fees[i];
+
+ if (GNUNET_TIME_timestamp_cmp (ts,
+ >=,
+ gf->start_date) &&
+ GNUNET_TIME_timestamp_cmp (ts,
+ <,
+ gf->end_date))
+ return gf;
+ }
+ return NULL;
+}
+
+
struct TALER_EXCHANGE_DenomPublicKey *
TALER_EXCHANGE_copy_denomination_key (
const struct TALER_EXCHANGE_DenomPublicKey *key)