diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-01-11 15:19:56 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-01-11 15:20:17 +0100 |
commit | 9443c10d7feb0d91323869dd08ec61ca781564f4 (patch) | |
tree | fd617ea56cc1d2ea370ce7e5467574a536b52d28 /src/auditor/taler-auditor.c | |
parent | 554da10133eb491b352a106b98ebeaed797133bb (diff) |
major refactoring, eliminating wire-plugins and moving towards new bank API. main code compiles, testcases known to fail, code sure not to fully work yet
Diffstat (limited to 'src/auditor/taler-auditor.c')
-rw-r--r-- | src/auditor/taler-auditor.c | 110 |
1 files changed, 3 insertions, 107 deletions
diff --git a/src/auditor/taler-auditor.c b/src/auditor/taler-auditor.c index 0cc2868f6..bb769fd6c 100644 --- a/src/auditor/taler-auditor.c +++ b/src/auditor/taler-auditor.c @@ -1010,8 +1010,7 @@ struct ReserveContext * @param reserve_pub public key of the reserve (also the WTID) * @param credit amount that was received * @param sender_account_details information about the sender's bank account - * @param wire_reference unique reference identifying the wire transfer (binary blob) - * @param wire_reference_size number of bytes in @a wire_reference + * @param wire_reference unique reference identifying the wire transfer * @param execution_date when did we receive the funds * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop */ @@ -1021,8 +1020,7 @@ handle_reserve_in (void *cls, const struct TALER_ReservePublicKeyP *reserve_pub, const struct TALER_Amount *credit, const char *sender_account_details, - const void *wire_reference, - size_t wire_reference_size, + uint64_t wire_reference, struct GNUNET_TIME_Absolute execution_date) { struct ReserveContext *rc = cls; @@ -2032,35 +2030,6 @@ analyze_reserves (void *cls) /** - * Information we keep per loaded wire plugin. - */ -struct WirePlugin -{ - - /** - * Kept in a DLL. - */ - struct WirePlugin *next; - - /** - * Kept in a DLL. - */ - struct WirePlugin *prev; - - /** - * Name of the wire method. - */ - char *type; - - /** - * Handle to the wire plugin. - */ - struct TALER_WIRE_Plugin *plugin; - -}; - - -/** * Information about wire fees charged by the exchange. */ struct WireFeeInfo @@ -2106,16 +2075,6 @@ struct AggregationContext { /** - * DLL of wire plugins encountered. - */ - struct WirePlugin *wire_head; - - /** - * DLL of wire plugins encountered. - */ - struct WirePlugin *wire_tail; - - /** * DLL of wire fees charged by the exchange. */ struct WireFeeInfo *fee_head; @@ -2133,46 +2092,6 @@ struct AggregationContext /** - * Find the relevant wire plugin. - * - * @param ac context to search - * @param type type of the wire plugin to load; it - * will be used _as is_ from the dynamic loader. - * @return NULL on error - */ -static struct TALER_WIRE_Plugin * -get_wire_plugin (struct AggregationContext *ac, - const char *type) -{ - struct WirePlugin *wp; - struct TALER_WIRE_Plugin *plugin; - - for (wp = ac->wire_head; NULL != wp; wp = wp->next) - if (0 == strcmp (type, - wp->type)) - return wp->plugin; - - /* Wants the exact *plugin name* (!= method) */ - plugin = TALER_WIRE_plugin_load (cfg, - type); - if (NULL == plugin) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Failed to locate wire plugin for `%s'\n", - type); - return NULL; - } - wp = GNUNET_new (struct WirePlugin); - wp->type = GNUNET_strdup (type); - wp->plugin = plugin; - GNUNET_CONTAINER_DLL_insert (ac->wire_head, - ac->wire_tail, - wp); - return plugin; -} - - -/** * Closure for #wire_transfer_information_cb. */ struct WireCheckContext @@ -2884,7 +2803,6 @@ check_wire_out_cb { struct AggregationContext *ac = cls; struct WireCheckContext wcc; - struct TALER_WIRE_Plugin *plugin; struct TALER_Amount final_amount; struct TALER_Amount exchange_gain; enum GNUNET_DB_QueryStatus qs; @@ -2976,19 +2894,7 @@ check_wire_out_cb } /* Round down to amount supported by wire method */ - plugin = get_wire_plugin - (ac, - TALER_WIRE_get_plugin_from_method (method)); - if (NULL == plugin) - { - GNUNET_break (0); - GNUNET_free (method); - return GNUNET_SYSERR; - } - GNUNET_free (method); - GNUNET_break (GNUNET_SYSERR != - plugin->amount_round (plugin->cls, - &final_amount)); + GNUNET_break (TALER_WIRE_amount_round (&final_amount)); /* Calculate the exchange's gain as the fees plus rounding differences! */ if (GNUNET_OK != @@ -3071,7 +2977,6 @@ static enum GNUNET_DB_QueryStatus analyze_aggregations (void *cls) { struct AggregationContext ac; - struct WirePlugin *wc; struct WireFeeInfo *wfi; enum GNUNET_DB_QueryStatus qsx; enum GNUNET_DB_QueryStatus qs; @@ -3125,15 +3030,6 @@ analyze_aggregations (void *cls) GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); ac.qs = qs; } - while (NULL != (wc = ac.wire_head)) - { - GNUNET_CONTAINER_DLL_remove (ac.wire_head, - ac.wire_tail, - wc); - TALER_WIRE_plugin_unload (wc->plugin); - GNUNET_free (wc->type); - GNUNET_free (wc); - } while (NULL != (wfi = ac.fee_head)) { GNUNET_CONTAINER_DLL_remove (ac.fee_head, |