aboutsummaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-merchant-httpd.h')
-rw-r--r--src/backend/taler-merchant-httpd.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/backend/taler-merchant-httpd.h b/src/backend/taler-merchant-httpd.h
index 0deaf170..c166efb4 100644
--- a/src/backend/taler-merchant-httpd.h
+++ b/src/backend/taler-merchant-httpd.h
@@ -267,6 +267,29 @@ struct TM_HandlerContext
/**
+ * Entry in a #resume_timeout_heap.
+ */
+struct TMH_SuspendedConnection
+{
+ /**
+ * Which connection was suspended.
+ */
+ struct MHD_Connection *con;
+
+ /**
+ * Key of this entry in the #payment_trigger_map
+ */
+ struct GNUNET_HashCode key;
+
+ /**
+ * Associated heap node.
+ */
+ struct GNUNET_CONTAINER_HeapNode *hn;
+
+};
+
+
+/**
* Locations from the configuration. Mapping from
* label to location data.
*/
@@ -291,6 +314,18 @@ extern struct TALER_Amount default_max_deposit_fee;
extern unsigned long long default_wire_fee_amortization;
/**
+ * MIN-Heap of suspended connections to resume when the timeout expires,
+ * ordered by timeout. Values are of type `struct TMH_SuspendedConnection`
+ */
+extern struct GNUNET_CONTAINER_Heap *resume_timeout_heap;
+
+/**
+ * Hash map from H(order_id,merchant_pub) to `struct TMH_SuspendedConnection`
+ * entries to resume when a payment is made for the given order.
+ */
+extern struct GNUNET_CONTAINER_MultiHashMap *payment_trigger_map;
+
+/**
* Which currency do we use?
*/
extern char *TMH_currency;
@@ -348,4 +383,18 @@ extern struct GNUNET_TIME_Relative default_pay_deadline;
void
TMH_trigger_daemon (void);
+/**
+ * Compute @a key to use for @a order_id and @a mpub in our
+ * #payment_trigger_map.
+ *
+ * @param order_id an order ID
+ * @param mpub an instance public key
+ * @param key[out] set to the hash map key to use
+ */
+void
+TMH_compute_pay_key (const char *order_id,
+ const struct TALER_MerchantPublicKeyP *mpub,
+ struct GNUNET_HashCode *key);
+
+
#endif