diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-06-05 15:05:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-06-05 15:05:28 +0200 |
commit | dcbb8d1cb68b8bcaaa87cfbe1d11c99e02492afc (patch) | |
tree | 546a41a0b677bf4d7eb27d024442553a00e67348 /src/mintdb | |
parent | 7c04d12ea262995672961f68f3f7e887ba020197 (diff) |
clean up postgres_get_reserve_history logic and improve docu
Diffstat (limited to 'src/mintdb')
-rw-r--r-- | src/mintdb/plugin_mintdb_postgres.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/mintdb/plugin_mintdb_postgres.c b/src/mintdb/plugin_mintdb_postgres.c index edbe31ac7..877cb58f6 100644 --- 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[] = { |