aboutsummaryrefslogtreecommitdiff
path: root/src/include/taler_exchangedb_plugin.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-03-12 11:33:10 +0100
committerChristian Grothoff <christian@grothoff.org>2018-03-12 11:33:10 +0100
commita166ca7fece8bbe3c66dcf0217cc81d20d185ab0 (patch)
treeb9cf10b1034e3f1d4d9c367ef2faa7e6bd206404 /src/include/taler_exchangedb_plugin.h
parent1ae2ba3d0a035734e4a28432e3246e58338fe9e8 (diff)
fix #5281 for exchange: do preflight check that an old transaction is no longer running by accident
Diffstat (limited to 'src/include/taler_exchangedb_plugin.h')
-rw-r--r--src/include/taler_exchangedb_plugin.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h
index ae38856a3..33677559a 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -1152,11 +1152,14 @@ struct TALER_EXCHANGEDB_Plugin
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
+ * @param name unique name identifying the transaction (for debugging),
+ * must point to a constant
* @return #GNUNET_OK on success
*/
int
(*start) (void *cls,
- struct TALER_EXCHANGEDB_Session *session);
+ struct TALER_EXCHANGEDB_Session *session,
+ const char *name);
/**
@@ -1172,6 +1175,19 @@ struct TALER_EXCHANGEDB_Plugin
/**
+ * Do a pre-flight check that we are not in an uncommitted transaction.
+ * If we are, try to commit the previous transaction and output a warning.
+ * Does not return anything, as we will continue regardless of the outcome.
+ *
+ * @param cls the `struct PostgresClosure` with the plugin-specific state
+ * @param session the database connection
+ */
+ void
+ (*preflight) (void *cls,
+ struct TALER_EXCHANGEDB_Session *session);
+
+
+ /**
* Abort/rollback a transaction.
*
* @param cls the @e cls of this struct with the plugin-specific state
@@ -1397,7 +1413,7 @@ struct TALER_EXCHANGEDB_Plugin
const struct TALER_CoinSpendPublicKeyP *coin_pub,
TALER_EXCHANGEDB_RefundCoinCallback cb,
void *cb_cls);
-
+
/**
* Mark a deposit as tiny, thereby declaring that it cannot be