aboutsummaryrefslogtreecommitdiff
path: root/src/mint/taler-mint-reservemod.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-29 20:45:45 +0100
committerChristian Grothoff <christian@grothoff.org>2015-01-29 20:45:45 +0100
commit7e462894288df92e93d1c44cbab86741c1d92798 (patch)
tree06f3787b899595137e5a525e6601fdfeef24f82d /src/mint/taler-mint-reservemod.c
parentd751c9c6dea06267259ca5fe934feeb26f6ea6db (diff)
-removing legacy TALER_TALER API, replacing with modern TALER_DB calls
Diffstat (limited to 'src/mint/taler-mint-reservemod.c')
-rw-r--r--src/mint/taler-mint-reservemod.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mint/taler-mint-reservemod.c b/src/mint/taler-mint-reservemod.c
index f531dbf4b..3f299ca38 100644
--- a/src/mint/taler-mint-reservemod.c
+++ b/src/mint/taler-mint-reservemod.c
@@ -27,6 +27,7 @@
#include "taler_util.h"
#include "taler_signatures.h"
#include "mint_db.h"
+#include "db_pq.h"
char *mintdir;
@@ -46,7 +47,7 @@ static PGconn *db_conn;
*
* @return ...
*/
-int
+static int
reservemod_add (struct TALER_Amount denom)
{
PGresult *result;
@@ -96,7 +97,6 @@ reservemod_add (struct TALER_Amount denom)
struct TALER_Amount old_denom;
struct TALER_Amount new_denom;
struct TALER_AmountNBO new_denom_nbo;
- int denom_indices[] = {0, 1, 2};
int param_lengths[] = {4, 4, 32};
int param_formats[] = {1, 1, 1};
const void *param_values[] = {
@@ -105,7 +105,12 @@ reservemod_add (struct TALER_Amount denom)
reserve_pub
};
- GNUNET_assert (GNUNET_OK == TALER_TALER_DB_extract_amount (result, 0, denom_indices, &old_denom));
+ GNUNET_assert (GNUNET_OK ==
+ TALER_DB_extract_amount (result, 0,
+ "balance_value",
+ "balance_fraction",
+ "balance_currency",
+ &old_denom));
new_denom = TALER_amount_add (old_denom, denom);
new_denom_nbo = TALER_amount_hton (new_denom);
result = PQexecParams (db_conn,