diff options
Diffstat (limited to 'src/mint/taler-mint-reservemod.c')
-rw-r--r-- | src/mint/taler-mint-reservemod.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/mint/taler-mint-reservemod.c b/src/mint/taler-mint-reservemod.c index 3dd94f84b..48a9c88b4 100644 --- a/src/mint/taler-mint-reservemod.c +++ b/src/mint/taler-mint-reservemod.c | |||
@@ -38,7 +38,7 @@ static PGconn *db_conn; | |||
38 | /** | 38 | /** |
39 | * Create a new or add to existing reserve. | 39 | * Create a new or add to existing reserve. |
40 | * Fails if currencies do not match. | 40 | * Fails if currencies do not match. |
41 | * | 41 | * |
42 | * @param denom denomination to add | 42 | * @param denom denomination to add |
43 | * | 43 | * |
44 | * @return ... | 44 | * @return ... |
@@ -72,7 +72,7 @@ reservemod_add (struct TALER_Amount denom) | |||
72 | reserve_pub, | 72 | reserve_pub, |
73 | &value, | 73 | &value, |
74 | &fraction, | 74 | &fraction, |
75 | denom.currency, | 75 | denom.currency, |
76 | &exnbo}; | 76 | &exnbo}; |
77 | int param_lengths[] = {32, 4, 4, strlen(denom.currency), 8}; | 77 | int param_lengths[] = {32, 4, 4, strlen(denom.currency), 8}; |
78 | int param_formats[] = {1, 1, 1, 1, 1}; | 78 | int param_formats[] = {1, 1, 1, 1, 1}; |
@@ -81,14 +81,14 @@ reservemod_add (struct TALER_Amount denom) | |||
81 | " expiration_date )" | 81 | " expiration_date )" |
82 | "values ($1,$2,$3,$4,$5);", | 82 | "values ($1,$2,$3,$4,$5);", |
83 | 5, NULL, (const char **) param_values, param_lengths, param_formats, 1); | 83 | 5, NULL, (const char **) param_values, param_lengths, param_formats, 1); |
84 | 84 | ||
85 | if (PGRES_COMMAND_OK != PQresultStatus (result)) | 85 | if (PGRES_COMMAND_OK != PQresultStatus (result)) |
86 | { | 86 | { |
87 | fprintf (stderr, "Insert failed: %s\n", PQresultErrorMessage (result)); | 87 | fprintf (stderr, "Insert failed: %s\n", PQresultErrorMessage (result)); |
88 | return GNUNET_SYSERR; | 88 | return GNUNET_SYSERR; |
89 | } | 89 | } |
90 | } | 90 | } |
91 | else | 91 | else |
92 | { | 92 | { |
93 | struct TALER_Amount old_denom; | 93 | struct TALER_Amount old_denom; |
94 | struct TALER_Amount new_denom; | 94 | struct TALER_Amount new_denom; |
@@ -125,8 +125,8 @@ reservemod_add (struct TALER_Amount denom) | |||
125 | return GNUNET_SYSERR; | 125 | return GNUNET_SYSERR; |
126 | } | 126 | } |
127 | 127 | ||
128 | } | 128 | } |
129 | return GNUNET_OK; | 129 | return GNUNET_OK; |
130 | } | 130 | } |
131 | 131 | ||
132 | 132 | ||
@@ -159,18 +159,18 @@ main (int argc, char *const *argv) | |||
159 | 159 | ||
160 | GNUNET_assert (GNUNET_OK == GNUNET_log_setup ("taler-mint-keycheck", "WARNING", NULL)); | 160 | GNUNET_assert (GNUNET_OK == GNUNET_log_setup ("taler-mint-keycheck", "WARNING", NULL)); |
161 | 161 | ||
162 | if (GNUNET_GETOPT_run ("taler-mint-keyup", options, argc, argv) < 0) | 162 | if (GNUNET_GETOPT_run ("taler-mint-keyup", options, argc, argv) < 0) |
163 | return 1; | 163 | return 1; |
164 | if (NULL == mintdir) | 164 | if (NULL == mintdir) |
165 | { | 165 | { |
166 | fprintf (stderr, "mint directory not given\n"); | 166 | fprintf (stderr, "mint directory not given\n"); |
167 | return 1; | 167 | return 1; |
168 | } | 168 | } |
169 | 169 | ||
170 | reserve_pub = GNUNET_new (struct GNUNET_CRYPTO_EddsaPublicKey); | 170 | reserve_pub = GNUNET_new (struct GNUNET_CRYPTO_EddsaPublicKey); |
171 | if ((NULL == reserve_pub_str) || | 171 | if ((NULL == reserve_pub_str) || |
172 | (GNUNET_OK != GNUNET_STRINGS_string_to_data (reserve_pub_str, | 172 | (GNUNET_OK != GNUNET_STRINGS_string_to_data (reserve_pub_str, |
173 | strlen (reserve_pub_str), | 173 | strlen (reserve_pub_str), |
174 | reserve_pub, | 174 | reserve_pub, |
175 | sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))) | 175 | sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))) |
176 | { | 176 | { |
@@ -178,7 +178,7 @@ main (int argc, char *const *argv) | |||
178 | return 1; | 178 | return 1; |
179 | } | 179 | } |
180 | 180 | ||
181 | kcfg = TALER_MINT_config_load (mintdir); | 181 | kcfg = TALER_config_load (mintdir); |
182 | if (NULL == kcfg) | 182 | if (NULL == kcfg) |
183 | { | 183 | { |
184 | fprintf (stderr, "can't load mint configuration\n"); | 184 | fprintf (stderr, "can't load mint configuration\n"); |
@@ -212,4 +212,3 @@ main (int argc, char *const *argv) | |||
212 | } | 212 | } |
213 | return 0; | 213 | return 0; |
214 | } | 214 | } |
215 | |||