aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/plugin_exchangedb_postgres.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-12-23 23:33:22 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2023-12-23 23:33:22 +0100
commit234b0cd56f69305f27ac5f6cd3828c0d115dcd0f (patch)
tree10d8f0872098d308cbaf2f0b6abb69936a104fb8 /src/exchangedb/plugin_exchangedb_postgres.c
parent13bb37b6a811451accc14b3501173637f2c28d10 (diff)
downloadexchange-234b0cd56f69305f27ac5f6cd3828c0d115dcd0f.tar.xz
Added appropriate response on contract-conflict during deposit
In case of a detected conflict during deposit, because (merchant_pub, h_contract_terms) already existed, with different other field values, we now provide the client an error response that contains the h_wire. This way, the client can retrieve further details about the conflicting transaction via /deposits/$H_WIRE/$MERCHANT_PUB/$H_CONTRACT_TERMS/$COIN_PUB Fixes #8002
Diffstat (limited to 'src/exchangedb/plugin_exchangedb_postgres.c')
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index 7d9044a1e..4e7bccbd2 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -121,6 +121,7 @@
#include "pg_get_policy_details.h"
#include "pg_persist_policy_details.h"
#include "pg_do_deposit.h"
+#include "pg_get_wire_hash_for_contract.h"
#include "pg_add_policy_fulfillment_proof.h"
#include "pg_do_melt.h"
#include "pg_do_refund.h"
@@ -584,6 +585,8 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
= &TEH_PG_persist_policy_details;
plugin->do_deposit
= &TEH_PG_do_deposit;
+ plugin->get_wire_hash_for_contract
+ = &TEH_PG_get_wire_hash_for_contract;
plugin->add_policy_fulfillment_proof
= &TEH_PG_add_policy_fulfillment_proof;
plugin->do_melt