exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit dcbb8d1cb68b8bcaaa87cfbe1d11c99e02492afc
parent 7c04d12ea262995672961f68f3f7e887ba020197
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri,  5 Jun 2015 15:05:28 +0200

clean up postgres_get_reserve_history logic and improve docu

Diffstat:
Msrc/mintdb/plugin_mintdb_postgres.c | 15+++++----------
1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/mintdb/plugin_mintdb_postgres.c b/src/mintdb/plugin_mintdb_postgres.c @@ -1509,11 +1509,14 @@ postgres_get_reserve_history (void *cls, struct TALER_MINTDB_CollectableBlindcoin *cbc; struct GNUNET_CRYPTO_rsa_PublicKey *denom_pub; struct GNUNET_CRYPTO_rsa_Signature *denom_sig; - struct TALER_PQ_QueryParam params[] = { TALER_PQ_query_param_auto_from_type (reserve_pub), TALER_PQ_query_param_end }; + + GNUNET_assert (NULL != rh); + GNUNET_assert (NULL != rh_tail); + GNUNET_assert (NULL == rh_tail->next); result = TALER_PQ_exec_prepared (session->conn, "get_reserves_blindcoins", params); @@ -1523,15 +1526,7 @@ postgres_get_reserve_history (void *cls, PQclear (result); goto cleanup; } - if (0 == (rows = PQntuples (result))) - { - PQclear (result); - ret = GNUNET_OK; /* It is OK if there are no withdrawls yet */ - goto cleanup; - } - GNUNET_assert (NULL != rh); - GNUNET_assert (NULL != rh_tail); - GNUNET_assert (NULL == rh_tail->next); + rows = PQntuples (result); while (0 < rows) { struct TALER_PQ_ResultSpec rs[] = {