fix #5010 for /track/transaction

This commit is contained in:
Christian Grothoff 2017-06-19 20:46:24 +02:00
parent a0c66e7919
commit 703c54a279
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
7 changed files with 257 additions and 309 deletions

View File

@ -27,6 +27,69 @@
#include "taler-exchange-httpd_validation.h" #include "taler-exchange-httpd_validation.h"
/**
* Add an incoming transaction to the database. Checks if the
* transaction is fresh (not a duplicate) and if so adds it to
* the database.
*
* @param connection the MHD connection to handle
* @param reserve_pub public key of the reserve
* @param amount amount to add to the reserve
* @param execution_time when did we receive the wire transfer
* @param sender_account_details which account send the funds
* @param transfer_details information that uniquely identifies the transfer
* @return MHD result code
*/
static int
execute_admin_add_incoming (struct MHD_Connection *connection,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_Amount *amount,
struct GNUNET_TIME_Absolute execution_time,
const json_t *sender_account_details,
const json_t *transfer_details)
{
struct TALER_EXCHANGEDB_Session *session;
int ret;
void *json_str;
if (NULL == (session = TEH_plugin->get_session (TEH_plugin->cls)))
{
GNUNET_break (0);
return TEH_RESPONSE_reply_internal_db_error (connection,
TALER_EC_DB_SETUP_FAILED);
}
json_str = json_dumps (transfer_details,
JSON_INDENT(2));
if (NULL == json_str)
{
GNUNET_break (0);
return TEH_RESPONSE_reply_internal_db_error (connection,
TALER_EC_PARSER_OUT_OF_MEMORY);
}
ret = TEH_plugin->reserves_in_insert (TEH_plugin->cls,
session,
reserve_pub,
amount,
execution_time,
sender_account_details,
json_str,
strlen (json_str));
free (json_str);
if (GNUNET_SYSERR == ret)
{
GNUNET_break (0);
return TEH_RESPONSE_reply_internal_db_error (connection,
TALER_EC_ADMIN_ADD_INCOMING_DB_STORE);
}
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:s}",
"status",
(GNUNET_OK == ret)
? "NEW"
: "DUP");
}
/** /**
* Handle a "/admin/add/incoming" request. Parses the * Handle a "/admin/add/incoming" request. Parses the
@ -108,7 +171,7 @@ TEH_ADMIN_handler_admin_add_incoming (struct TEH_RequestHandler *rh,
TALER_EC_ADMIN_ADD_INCOMING_CURRENCY_UNSUPPORTED, TALER_EC_ADMIN_ADD_INCOMING_CURRENCY_UNSUPPORTED,
"amount:currency"); "amount:currency");
} }
res = TEH_DB_execute_admin_add_incoming (connection, res = execute_admin_add_incoming (connection,
&reserve_pub, &reserve_pub,
&amount, &amount,
at, at,

View File

@ -1145,68 +1145,4 @@ TEH_DB_execute_refresh_link (struct MHD_Connection *connection,
} }
/**
* Add an incoming transaction to the database. Checks if the
* transaction is fresh (not a duplicate) and if so adds it to
* the database.
*
* @param connection the MHD connection to handle
* @param reserve_pub public key of the reserve
* @param amount amount to add to the reserve
* @param execution_time when did we receive the wire transfer
* @param sender_account_details which account send the funds
* @param transfer_details information that uniquely identifies the transfer
* @return MHD result code
*/
int
TEH_DB_execute_admin_add_incoming (struct MHD_Connection *connection,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_Amount *amount,
struct GNUNET_TIME_Absolute execution_time,
const json_t *sender_account_details,
const json_t *transfer_details)
{
struct TALER_EXCHANGEDB_Session *session;
int ret;
void *json_str;
if (NULL == (session = TEH_plugin->get_session (TEH_plugin->cls)))
{
GNUNET_break (0);
return TEH_RESPONSE_reply_internal_db_error (connection,
TALER_EC_DB_SETUP_FAILED);
}
json_str = json_dumps (transfer_details,
JSON_INDENT(2));
if (NULL == json_str)
{
GNUNET_break (0);
return TEH_RESPONSE_reply_internal_db_error (connection,
TALER_EC_PARSER_OUT_OF_MEMORY);
}
ret = TEH_plugin->reserves_in_insert (TEH_plugin->cls,
session,
reserve_pub,
amount,
execution_time,
sender_account_details,
json_str,
strlen (json_str));
free (json_str);
if (GNUNET_SYSERR == ret)
{
GNUNET_break (0);
return TEH_RESPONSE_reply_internal_db_error (connection,
TALER_EC_ADMIN_ADD_INCOMING_DB_STORE);
}
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:s}",
"status",
(GNUNET_OK == ret)
? "NEW"
: "DUP");
}
/* end of taler-exchange-httpd_db.c */ /* end of taler-exchange-httpd_db.c */

View File

@ -175,27 +175,5 @@ int
TEH_DB_execute_refresh_link (struct MHD_Connection *connection, TEH_DB_execute_refresh_link (struct MHD_Connection *connection,
const struct TALER_CoinSpendPublicKeyP *coin_pub); const struct TALER_CoinSpendPublicKeyP *coin_pub);
/**
* Add an incoming transaction to the database.
*
* @param connection the MHD connection to handle
* @param reserve_pub public key of the reserve
* @param amount amount to add to the reserve
* @param execution_time when did we receive the wire transfer
* @param sender_account_details which account send the funds
* @param transfer_details information that uniquely identifies the transfer
* @return MHD result code
*/
int
TEH_DB_execute_admin_add_incoming (struct MHD_Connection *connection,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_Amount *amount,
struct GNUNET_TIME_Absolute execution_time,
const json_t *sender_account_details,
const json_t *transfer_details);
#endif #endif
/* TALER_EXCHANGE_HTTPD_DB_H */ /* TALER_EXCHANGE_HTTPD_DB_H */

View File

@ -44,8 +44,8 @@
* @param exec_time execution time of the wire transfer * @param exec_time execution time of the wire transfer
* @return MHD result code * @return MHD result code
*/ */
int static int
TEH_RESPONSE_reply_track_transaction (struct MHD_Connection *connection, reply_track_transaction (struct MHD_Connection *connection,
const struct GNUNET_HashCode *h_contract_terms, const struct GNUNET_HashCode *h_contract_terms,
const struct GNUNET_HashCode *h_wire, const struct GNUNET_HashCode *h_wire,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,
@ -87,29 +87,47 @@ struct DepositWtidContext
{ {
/** /**
* Where should we send the reply? * Deposit details.
*/ */
struct MHD_Connection *connection; const struct TALER_DepositTrackPS *tps;
/** /**
* Hash of the proposal data we are looking up. * Public key of the merchant.
*/ */
struct GNUNET_HashCode h_contract_terms; const struct TALER_MerchantPublicKeyP *merchant_pub;
/** /**
* Hash of the wire transfer details we are looking up. * Set by #handle_wtid data to the wire transfer ID.
*/ */
struct GNUNET_HashCode h_wire; struct TALER_WireTransferIdentifierRawP wtid;
/** /**
* Public key we are looking up. * Set by #handle_wtid data to the coin's contribution to the wire transfer.
*/ */
struct TALER_CoinSpendPublicKeyP coin_pub; struct TALER_Amount coin_contribution;
/** /**
* MHD result code to return. * Set by #handle_wtid data to the fee charged to the coin.
*/ */
int res; struct TALER_Amount coin_fee;
/**
* Set by #handle_wtid data to the wire transfer execution time.
*/
struct GNUNET_TIME_Absolute execution_time;
/**
* Set by #handle_wtid to the coin contribution to the transaction
* (that is, @e coin_contribution minus @e coin_fee).
*/
struct TALER_Amount coin_delta;
/**
* Set to #GNUNET_YES by #handle_wtid if the wire transfer is still pending
* (and the above were not set).
* Set to #GNUNET_SYSERR if there was a serious error.
*/
int pending;
}; };
@ -136,35 +154,26 @@ handle_wtid_data (void *cls,
struct GNUNET_TIME_Absolute execution_time) struct GNUNET_TIME_Absolute execution_time)
{ {
struct DepositWtidContext *ctx = cls; struct DepositWtidContext *ctx = cls;
struct TALER_Amount coin_delta;
if (NULL == wtid) if (NULL == wtid)
{ {
ctx->res = TEH_RESPONSE_reply_transfer_pending (ctx->connection, ctx->pending = GNUNET_YES;
execution_time); ctx->execution_time = execution_time;
return;
} }
else
{
if (GNUNET_SYSERR == if (GNUNET_SYSERR ==
TALER_amount_subtract (&coin_delta, TALER_amount_subtract (&ctx->coin_delta,
coin_contribution, coin_contribution,
coin_fee)) coin_fee))
{ {
GNUNET_break (0); GNUNET_break (0);
ctx->res = TEH_RESPONSE_reply_internal_db_error (ctx->connection, ctx->pending = GNUNET_SYSERR;
TALER_EC_TRACK_TRANSACTION_DB_FEE_INCONSISTENT); return;
}
else
{
ctx->res = TEH_RESPONSE_reply_track_transaction (ctx->connection,
&ctx->h_contract_terms,
&ctx->h_wire,
&ctx->coin_pub,
&coin_delta,
wtid,
execution_time);
}
} }
ctx->wtid = *wtid;
ctx->execution_time = execution_time;
ctx->coin_contribution = *coin_contribution;
ctx->coin_fee = *coin_fee;
} }
@ -172,64 +181,53 @@ handle_wtid_data (void *cls,
* Execute a "/track/transaction". Returns the transfer information * Execute a "/track/transaction". Returns the transfer information
* associated with the given deposit. * associated with the given deposit.
* *
* @param connection the MHD connection to handle * If it returns a non-error code, the transaction logic MUST
* @param h_contract_terms hash of the proposal data * NOT queue a MHD response. IF it returns an hard error, the
* @param h_wire hash of the wire details * transaction logic MUST queue a MHD response and set @a mhd_ret. IF
* @param coin_pub public key of the coin to link * it returns the soft error code, the function MAY be called again to
* @param merchant_pub public key of the merchant * retry and MUST not queue a MHD response.
* @return MHD result code *
* @param cls closure of type `struct DepositWtidContext *`
* @param connection MHD request which triggered the transaction
* @param session database session to use
* @param[out] mhd_ret set to MHD response status for @a connection,
* if transaction failed (!)
* @return transaction status
*/ */
int static enum GNUNET_DB_QueryStatus
TEH_DB_execute_track_transaction (struct MHD_Connection *connection, track_transaction_transaction (void *cls,
const struct GNUNET_HashCode *h_contract_terms, struct MHD_Connection *connection,
const struct GNUNET_HashCode *h_wire, struct TALER_EXCHANGEDB_Session *session,
const struct TALER_CoinSpendPublicKeyP *coin_pub, int *mhd_ret)
const struct TALER_MerchantPublicKeyP *merchant_pub)
{ {
int ret; struct DepositWtidContext *ctx = cls;
struct DepositWtidContext ctx; enum GNUNET_DB_QueryStatus qs;
struct TALER_EXCHANGEDB_Session *session;
if (NULL == (session = TEH_plugin->get_session (TEH_plugin->cls))) qs = TEH_plugin->wire_lookup_deposit_wtid (TEH_plugin->cls,
{
GNUNET_break (0);
return TEH_RESPONSE_reply_internal_db_error (connection,
TALER_EC_DB_SETUP_FAILED);
}
ctx.connection = connection;
ctx.h_contract_terms = *h_contract_terms;
ctx.h_wire = *h_wire;
ctx.coin_pub = *coin_pub;
ctx.res = GNUNET_SYSERR;
ret = TEH_plugin->wire_lookup_deposit_wtid (TEH_plugin->cls,
session, session,
h_contract_terms, &ctx->tps->h_contract_terms,
h_wire, &ctx->tps->h_wire,
coin_pub, &ctx->tps->coin_pub,
merchant_pub, ctx->merchant_pub,
&handle_wtid_data, &handle_wtid_data,
&ctx); ctx);
if (GNUNET_SYSERR == ret) if (0 > qs)
{
if (GNUNET_DB_STATUS_HARD_ERROR == qs)
{ {
GNUNET_break (0); GNUNET_break (0);
GNUNET_break (GNUNET_SYSERR == ctx.res); *mhd_ret = TEH_RESPONSE_reply_internal_db_error (connection,
return TEH_RESPONSE_reply_internal_db_error (connection,
TALER_EC_TRACK_TRANSACTION_DB_FETCH_FAILED); TALER_EC_TRACK_TRANSACTION_DB_FETCH_FAILED);
} }
if (GNUNET_NO == ret) return qs;
}
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
{ {
GNUNET_break (GNUNET_SYSERR == ctx.res); *mhd_ret = TEH_RESPONSE_reply_transaction_unknown (connection,
return TEH_RESPONSE_reply_transaction_unknown (connection,
TALER_EC_TRACK_TRANSACTION_NOT_FOUND); TALER_EC_TRACK_TRANSACTION_NOT_FOUND);
return GNUNET_DB_STATUS_HARD_ERROR;
} }
if (GNUNET_SYSERR == ctx.res) return qs;
{
GNUNET_break (0);
return TEH_RESPONSE_reply_internal_error (connection,
TALER_EC_TRACK_TRANSACTION_WTID_RESOLUTION_ERROR,
"bug resolving deposit wtid");
}
return ctx.res;
} }
@ -246,9 +244,12 @@ TEH_DB_execute_track_transaction (struct MHD_Connection *connection,
static int static int
check_and_handle_track_transaction_request (struct MHD_Connection *connection, check_and_handle_track_transaction_request (struct MHD_Connection *connection,
const struct TALER_DepositTrackPS *tps, const struct TALER_DepositTrackPS *tps,
struct TALER_MerchantPublicKeyP *merchant_pub, const struct TALER_MerchantPublicKeyP *merchant_pub,
struct TALER_MerchantSignatureP *merchant_sig) const struct TALER_MerchantSignatureP *merchant_sig)
{ {
struct DepositWtidContext ctx;
int mhd_ret;
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION,
&tps->purpose, &tps->purpose,
@ -260,11 +261,29 @@ check_and_handle_track_transaction_request (struct MHD_Connection *connection,
TALER_EC_TRACK_TRANSACTION_MERCHANT_SIGNATURE_INVALID, TALER_EC_TRACK_TRANSACTION_MERCHANT_SIGNATURE_INVALID,
"merchant_sig"); "merchant_sig");
} }
return TEH_DB_execute_track_transaction (connection, ctx.pending = GNUNET_NO;
ctx.tps = tps;
ctx.merchant_pub = merchant_pub;
if (GNUNET_OK !=
TEH_DB_run_transaction (connection,
&mhd_ret,
&track_transaction_transaction,
&ctx))
return mhd_ret;
if (GNUNET_YES == ctx.pending)
return TEH_RESPONSE_reply_transfer_pending (connection,
ctx.execution_time);
if (GNUNET_SYSERR == ctx.pending)
return TEH_RESPONSE_reply_internal_db_error (connection,
TALER_EC_TRACK_TRANSACTION_DB_FEE_INCONSISTENT);
return reply_track_transaction (connection,
&tps->h_contract_terms, &tps->h_contract_terms,
&tps->h_wire, &tps->h_wire,
&tps->coin_pub, &tps->coin_pub,
merchant_pub); &ctx.coin_delta,
&ctx.wtid,
ctx.execution_time);
} }

View File

@ -4584,10 +4584,9 @@ postgres_lookup_wire_transfer (void *cls,
* @param merchant_pub merchant public key * @param merchant_pub merchant public key
* @param cb function to call with the result * @param cb function to call with the result
* @param cb_cls closure to pass to @a cb * @param cb_cls closure to pass to @a cb
* @return #GNUNET_OK on success, #GNUNET_SYSERR on DB errors, * @return transaction status code
* #GNUNET_NO if nothing was found
*/ */
static int static enum GNUNET_DB_QueryStatus
postgres_wire_lookup_deposit_wtid (void *cls, postgres_wire_lookup_deposit_wtid (void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *h_contract_terms, const struct GNUNET_HashCode *h_contract_terms,
@ -4597,7 +4596,7 @@ postgres_wire_lookup_deposit_wtid (void *cls,
TALER_EXCHANGEDB_TrackTransactionCallback cb, TALER_EXCHANGEDB_TrackTransactionCallback cb,
void *cb_cls) void *cb_cls)
{ {
PGresult *result; enum GNUNET_DB_QueryStatus qs;
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (coin_pub), GNUNET_PQ_query_param_auto_from_type (coin_pub),
GNUNET_PQ_query_param_auto_from_type (h_contract_terms), GNUNET_PQ_query_param_auto_from_type (h_contract_terms),
@ -4605,94 +4604,6 @@ postgres_wire_lookup_deposit_wtid (void *cls,
GNUNET_PQ_query_param_auto_from_type (merchant_pub), GNUNET_PQ_query_param_auto_from_type (merchant_pub),
GNUNET_PQ_query_param_end GNUNET_PQ_query_param_end
}; };
int nrows;
/* check if the melt record exists and get it */
result = GNUNET_PQ_exec_prepared (session->conn,
"lookup_deposit_wtid",
params);
if (PGRES_TUPLES_OK != PQresultStatus (result))
{
BREAK_DB_ERR (result, session->conn);
PQclear (result);
return GNUNET_SYSERR;
}
nrows = PQntuples (result);
if (0 == nrows)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"lookup_deposit_wtid returned 0 matching rows\n");
PQclear (result);
/* Check if transaction exists in deposits, so that we just
do not have a WTID yet, if so, do call the CB with a NULL wtid
and return #GNUNET_YES! */
{
struct GNUNET_PQ_QueryParam params2[] = {
GNUNET_PQ_query_param_auto_from_type (coin_pub),
GNUNET_PQ_query_param_auto_from_type (merchant_pub),
GNUNET_PQ_query_param_auto_from_type (h_contract_terms),
GNUNET_PQ_query_param_auto_from_type (h_wire),
GNUNET_PQ_query_param_end
};
result = GNUNET_PQ_exec_prepared (session->conn,
"get_deposit_for_wtid",
params2);
if (PGRES_TUPLES_OK != PQresultStatus (result))
{
BREAK_DB_ERR (result, session->conn);
PQclear (result);
return GNUNET_SYSERR;
}
}
nrows = PQntuples (result);
if (0 == nrows)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"get_deposit_for_wtid returned 0 matching rows\n");
PQclear (result);
return GNUNET_NO;
}
/* Ok, we're aware of the transaction, but it has not yet been
executed */
{
struct GNUNET_TIME_Absolute exec_time;
struct TALER_Amount amount_with_fee;
struct TALER_Amount deposit_fee;
struct GNUNET_PQ_ResultSpec rs[] = {
TALER_PQ_result_spec_amount ("amount_with_fee", &amount_with_fee),
TALER_PQ_result_spec_amount ("fee_deposit", &deposit_fee),
GNUNET_PQ_result_spec_absolute_time ("wire_deadline", &exec_time),
GNUNET_PQ_result_spec_end
};
if (GNUNET_OK !=
GNUNET_PQ_extract_result (result,
rs,
0))
{
GNUNET_break (0);
PQclear (result);
return GNUNET_SYSERR;
}
cb (cb_cls,
NULL,
&amount_with_fee,
&deposit_fee,
exec_time);
PQclear (result);
return GNUNET_YES;
}
}
if (1 != nrows)
{
GNUNET_break (0);
PQclear (result);
return GNUNET_SYSERR;
}
{
struct TALER_WireTransferIdentifierRawP wtid; struct TALER_WireTransferIdentifierRawP wtid;
struct GNUNET_TIME_Absolute exec_time; struct GNUNET_TIME_Absolute exec_time;
struct TALER_Amount amount_with_fee; struct TALER_Amount amount_with_fee;
@ -4704,23 +4615,65 @@ postgres_wire_lookup_deposit_wtid (void *cls,
TALER_PQ_result_spec_amount ("fee_deposit", &deposit_fee), TALER_PQ_result_spec_amount ("fee_deposit", &deposit_fee),
GNUNET_PQ_result_spec_end GNUNET_PQ_result_spec_end
}; };
if (GNUNET_OK !=
GNUNET_PQ_extract_result (result, /* check if the melt record exists and get it */
rs, qs = GNUNET_PQ_eval_prepared_singleton_select (session->conn,
0)) "lookup_deposit_wtid",
params,
rs);
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs)
{ {
GNUNET_break (0);
PQclear (result);
return GNUNET_SYSERR;
}
cb (cb_cls, cb (cb_cls,
&wtid, &wtid,
&amount_with_fee, &amount_with_fee,
&deposit_fee, &deposit_fee,
exec_time); exec_time);
return qs;
}
if (0 > qs)
return qs;
GNUNET_assert (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"lookup_deposit_wtid returned 0 matching rows\n");
{
/* Check if transaction exists in deposits, so that we just
do not have a WTID yet, if so, do call the CB with a NULL wtid
and return #GNUNET_YES! */
struct GNUNET_PQ_QueryParam params2[] = {
GNUNET_PQ_query_param_auto_from_type (coin_pub),
GNUNET_PQ_query_param_auto_from_type (merchant_pub),
GNUNET_PQ_query_param_auto_from_type (h_contract_terms),
GNUNET_PQ_query_param_auto_from_type (h_wire),
GNUNET_PQ_query_param_end
};
struct GNUNET_TIME_Absolute exec_time;
struct TALER_Amount amount_with_fee;
struct TALER_Amount deposit_fee;
struct GNUNET_PQ_ResultSpec rs2[] = {
TALER_PQ_result_spec_amount ("amount_with_fee", &amount_with_fee),
TALER_PQ_result_spec_amount ("fee_deposit", &deposit_fee),
GNUNET_PQ_result_spec_absolute_time ("wire_deadline", &exec_time),
GNUNET_PQ_result_spec_end
};
qs = GNUNET_PQ_eval_prepared_singleton_select (session->conn,
"get_deposit_for_wtid",
params2,
rs2);
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs)
{
/* Ok, we're aware of the transaction, but it has not yet been
executed */
cb (cb_cls,
NULL,
&amount_with_fee,
&deposit_fee,
exec_time);
return qs;
}
return qs;
} }
PQclear (result);
return GNUNET_OK;
} }

View File

@ -1313,7 +1313,7 @@ test_wire_out (struct TALER_EXCHANGEDB_Session *session,
struct GNUNET_HashCode h_contract_terms_wt2 = h_contract_terms_wt; struct GNUNET_HashCode h_contract_terms_wt2 = h_contract_terms_wt;
h_contract_terms_wt2.bits[0]++; h_contract_terms_wt2.bits[0]++;
FAILIF (GNUNET_NO != FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
plugin->wire_lookup_deposit_wtid (plugin->cls, plugin->wire_lookup_deposit_wtid (plugin->cls,
session, session,
&h_contract_terms_wt2, &h_contract_terms_wt2,
@ -1350,7 +1350,7 @@ test_wire_out (struct TALER_EXCHANGEDB_Session *session,
&wire_out_wtid, &wire_out_wtid,
&cb_wt_check, &cb_wt_check,
&cb_wt_never)); &cb_wt_never));
FAILIF (GNUNET_OK != FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->wire_lookup_deposit_wtid (plugin->cls, plugin->wire_lookup_deposit_wtid (plugin->cls,
session, session,
&h_contract_terms_wt, &h_contract_terms_wt,

View File

@ -1754,10 +1754,9 @@ struct TALER_EXCHANGEDB_Plugin
* @param merchant_pub merchant public key * @param merchant_pub merchant public key
* @param cb function to call with the result * @param cb function to call with the result
* @param cb_cls closure to pass to @a cb * @param cb_cls closure to pass to @a cb
* @return #GNUNET_OK on success, #GNUNET_SYSERR on DB errors, * @return transaction status code
* #GNUNET_NO if nothing was found
*/ */
int enum GNUNET_DB_QueryStatus
(*wire_lookup_deposit_wtid)(void *cls, (*wire_lookup_deposit_wtid)(void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *h_contract_terms, const struct GNUNET_HashCode *h_contract_terms,