From 234b0cd56f69305f27ac5f6cd3828c0d115dcd0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Sat, 23 Dec 2023 23:33:22 +0100 Subject: 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 --- src/exchangedb/plugin_exchangedb_postgres.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/exchangedb/plugin_exchangedb_postgres.c') 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 -- cgit v1.2.3