aboutsummaryrefslogtreecommitdiff
path: root/src/util/util.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-03-05 14:36:49 +0100
committerChristian Grothoff <christian@grothoff.org>2022-03-05 14:36:55 +0100
commit7ff58c3d8f2351c57142b4b65ab75304f355fc4f (patch)
tree4d5de28cbc2cb51b9946c924b7dd228cfe0d0634 /src/util/util.c
parent8a906bf96c9c418dbd58727284eb5cfdd6fdff24 (diff)
downloadexchange-7ff58c3d8f2351c57142b4b65ab75304f355fc4f.tar.xz
refactor /wire to include logic to return the wad fee (for W2W payments)
Diffstat (limited to 'src/util/util.c')
-rw-r--r--src/util/util.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/util/util.c b/src/util/util.c
index 6dfd65574..33b0a77cc 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -124,6 +124,46 @@ TALER_wire_fee_set_ntoh (struct TALER_WireFeeSet *fees,
}
+int
+TALER_global_fee_set_cmp (const struct TALER_GlobalFeeSet *f1,
+ const struct TALER_GlobalFeeSet *f2)
+{
+ int ret;
+
+ ret = TALER_amount_cmp (&f1->history,
+ &f2->history);
+ if (0 != ret)
+ return ret;
+ ret = TALER_amount_cmp (&f1->kyc,
+ &f2->kyc);
+ if (0 != ret)
+ return ret;
+ return 0;
+}
+
+
+int
+TALER_wire_fee_set_cmp (const struct TALER_WireFeeSet *f1,
+ const struct TALER_WireFeeSet *f2)
+{
+ int ret;
+
+ ret = TALER_amount_cmp (&f1->wire,
+ &f2->wire);
+ if (0 != ret)
+ return ret;
+ ret = TALER_amount_cmp (&f1->closing,
+ &f2->closing);
+ if (0 != ret)
+ return ret;
+ ret = TALER_amount_cmp (&f1->wad,
+ &f2->wad);
+ if (0 != ret)
+ return ret;
+ return 0;
+}
+
+
enum GNUNET_GenericReturnValue
TALER_denom_fee_check_currency (
const char *currency,