From c20f955ae43a57208b40d9a7978a7f089592ad60 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 9 Dec 2015 15:36:34 +0100 Subject: towards /deposit/wtid handling (more skeleton work) --- src/mintdb/plugin_mintdb_postgres.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/mintdb') diff --git a/src/mintdb/plugin_mintdb_postgres.c b/src/mintdb/plugin_mintdb_postgres.c index f2d652b2..62af73c8 100644 --- a/src/mintdb/plugin_mintdb_postgres.c +++ b/src/mintdb/plugin_mintdb_postgres.c @@ -3356,7 +3356,6 @@ postgres_get_coin_transactions (void *cls, } PQclear (result); } - /* FIXME: Handle locked coins (#3625) */ return head; cleanup: if (NULL != head) @@ -3366,6 +3365,36 @@ postgres_get_coin_transactions (void *cls, } +/** + * Try to find the wire transfer details for a deposit operation. + * If we did not execute the deposit yet, return when it is supposed + * to be executed. + * + * @param cls closure + * @param h_contract hash of the contract + * @param h_wire hash of merchant wire details + * @param coin_pub public key of deposited coin + * @param merchant_pub merchant public key + * @param transaction_id transaction identifier + * @param cb function to call with the result + * @param cb_cls closure to pass to @a cb + * @return #GNUNET_OK on success, #GNUNET_SYSERR on DB errors + */ +static int +postgres_wire_lookup_deposit_wtid (void *cls, + const struct GNUNET_HashCode *h_contract, + const struct GNUNET_HashCode *h_wire, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_MerchantPublicKeyP *merchant_pub, + uint64_t transaction_id, + TALER_MINTDB_DepositWtidCallback cb, + void *cb_cls) +{ + GNUNET_break (0); // not implemented + return GNUNET_SYSERR; +} + + /** * Initialize Postgres database subsystem. * @@ -3437,6 +3466,7 @@ libtaler_plugin_mintdb_postgres_init (void *cls) plugin->get_transfer = &postgres_get_transfer; plugin->get_coin_transactions = &postgres_get_coin_transactions; plugin->free_coin_transaction_list = &common_free_coin_transaction_list; + plugin->wire_lookup_deposit_wtid = &postgres_wire_lookup_deposit_wtid; return plugin; } -- cgit v1.2.3 From 8e75ccaa714adf21469cefea68efada8aa1ab4c7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 20 Dec 2015 13:00:06 +0100 Subject: -check return value --- src/mint-lib/test_mint_api.c | 1 + src/mintdb/perf_taler_mintdb_interpreter.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mintdb') diff --git a/src/mint-lib/test_mint_api.c b/src/mint-lib/test_mint_api.c index 5f465363..024e080f 100644 --- a/src/mint-lib/test_mint_api.c +++ b/src/mint-lib/test_mint_api.c @@ -1524,6 +1524,7 @@ interpreter_run (void *cls, fail (is); return; } + json_decref (wire); trigger_context_task (); return; } diff --git a/src/mintdb/perf_taler_mintdb_interpreter.c b/src/mintdb/perf_taler_mintdb_interpreter.c index 31f5d650..9084513f 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.c +++ b/src/mintdb/perf_taler_mintdb_interpreter.c @@ -1735,7 +1735,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) 1, 1, refresh_commit); - + GNUNET_assert (GNUNET_OK == ret); } break; -- cgit v1.2.3