diff options
| author | Christian Grothoff <christian@grothoff.org> | 2018-03-12 11:33:10 +0100 | 
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2018-03-12 11:33:10 +0100 | 
| commit | a166ca7fece8bbe3c66dcf0217cc81d20d185ab0 (patch) | |
| tree | b9cf10b1034e3f1d4d9c367ef2faa7e6bd206404 /src/include | |
| parent | 1ae2ba3d0a035734e4a28432e3246e58338fe9e8 (diff) | |
fix #5281 for exchange: do preflight check that an old transaction is no longer running by accident
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/taler_exchangedb_plugin.h | 20 | 
1 files changed, 18 insertions, 2 deletions
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index ae38856a..33677559 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  | 
