aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/plugin_exchangedb_postgres.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-12-21 23:57:23 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2023-12-21 23:57:23 +0100
commitfa5582930e6198e2783ae9cad59d2d2b4ce2ee1a (patch)
tree12fc2dd1398e403d63dbabcef33ad7b62de0bf8d /src/exchangedb/plugin_exchangedb_postgres.c
parent98ca8478952ab57b3a9f3b8f9efc4a7bb11d2a53 (diff)
[wip, #7267] more refined denomination conflict response during deposit
If a coin was known but with a different denomination, return to the client an error response that contains the denomination's public key and the corresponding signature of the provided coin.
Diffstat (limited to 'src/exchangedb/plugin_exchangedb_postgres.c')
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index 51dbea659..7d9044a1e 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -130,6 +130,7 @@
#include "pg_count_known_coins.h"
#include "pg_ensure_coin_known.h"
#include "pg_get_known_coin.h"
+#include "pg_get_signature_for_known_coin.h"
#include "pg_get_coin_denomination.h"
#include "pg_have_deposit2.h"
#include "pg_aggregate.h"
@@ -232,14 +233,14 @@
* @param conn SQL connection that was used
*/
#define BREAK_DB_ERR(result,conn) do { \
- GNUNET_break (0); \
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \
- "Database failure: %s/%s/%s/%s/%s", \
- PQresultErrorField (result, PG_DIAG_MESSAGE_PRIMARY), \
- PQresultErrorField (result, PG_DIAG_MESSAGE_DETAIL), \
- PQresultErrorMessage (result), \
- PQresStatus (PQresultStatus (result)), \
- PQerrorMessage (conn)); \
+ GNUNET_break (0); \
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \
+ "Database failure: %s/%s/%s/%s/%s", \
+ PQresultErrorField (result, PG_DIAG_MESSAGE_PRIMARY), \
+ PQresultErrorField (result, PG_DIAG_MESSAGE_DETAIL), \
+ PQresultErrorMessage (result), \
+ PQresStatus (PQresultStatus (result)), \
+ PQerrorMessage (conn)); \
} while (0)
@@ -601,6 +602,8 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
= &TEH_PG_ensure_coin_known;
plugin->get_known_coin
= &TEH_PG_get_known_coin;
+ plugin->get_signature_for_known_coin
+ = &TEH_PG_get_signature_for_known_coin;
plugin->get_coin_denomination
= &TEH_PG_get_coin_denomination;
plugin->have_deposit2