From 00a03bf279e21ce4e87fbc0dc54fef37de84c297 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 17 Apr 2020 15:11:16 +0200 Subject: sketch instance loading --- src/backend/taler-merchant-httpd.h | 75 +++++++++++++------------------------- 1 file changed, 25 insertions(+), 50 deletions(-) (limited to 'src/backend/taler-merchant-httpd.h') diff --git a/src/backend/taler-merchant-httpd.h b/src/backend/taler-merchant-httpd.h index b2e1a599..52563e77 100644 --- a/src/backend/taler-merchant-httpd.h +++ b/src/backend/taler-merchant-httpd.h @@ -94,11 +94,6 @@ struct TMH_MerchantInstance */ char *name; - /** - * File holding the merchant's private key - */ - char *keyfile; - /** * Next entry in DLL. */ @@ -110,7 +105,7 @@ struct TMH_MerchantInstance struct TMH_WireMethod *wm_tail; /** - * Merchant's private key + * Merchant's private key. */ struct TALER_MerchantPrivateKeyP privkey; @@ -120,54 +115,15 @@ struct TMH_MerchantInstance struct TALER_MerchantPublicKeyP pubkey; /** - * Default maximum wire fee to assume, unless stated differently in the proposal - * already. - */ - struct TALER_Amount default_max_wire_fee; - - /** - * Default max deposit fee that the merchant is willing to - * pay; if deposit costs more, then the customer will cover - * the difference. - */ - struct TALER_Amount default_max_deposit_fee; - - /** - * Default factor for wire fee amortization. - */ - unsigned long long default_wire_fee_amortization; - - /** - * If the frontend does NOT specify an execution date, how long should - * we tell the exchange to wait to aggregate transactions before - * executing the wire transfer? This delay is added to the current - * time when we generate the advisory execution time for the exchange. - */ - struct GNUNET_TIME_Relative default_wire_transfer_delay; - - /** - * If the frontend does NOT specify a payment deadline, how long should - * offers we make be valid by default? - */ - struct GNUNET_TIME_Relative default_pay_deadline; - - /** - * Exchange this instance uses for tipping, NULL if tipping - * is not supported. - */ - char *tip_exchange; - - /** - * Locations from the configuration. Mapping from - * label to location data. + * General settings for an instance. */ - json_t *default_locations; + struct TALER_MERCHANTDB_InstanceSettings settings; /** - * What is the private key of the reserve used for signing tips by this exchange? - * Only valid if @e tip_exchange is non-null. + * Reference counter on this structure. Only destroyed if the + * counter hits zero. */ - struct TALER_ReservePrivateKeyP tip_reserve; + unsigned int rc; }; @@ -444,4 +400,23 @@ TMH_long_poll_resume (const char *order_id, const struct TALER_Amount *refund_amount); +/** + * Decrement reference counter of @a mi, and free if it hits zero. + * + * @param[in,out] mi merchant instance to update and possibly free + */ +void +TMH_instance_decref (struct TMH_MerchantInstance *mi); + + +/** + * Add instance definition to our active set of instances. + * + * @param[in,out] mi merchant instance details to define + * @return #GNUNET_OK on success, #GNUNET_NO if the same ID is in use already + */ +int +TMH_add_instance (struct TMH_MerchantInstance *mi); + + #endif -- cgit v1.2.3