diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-09-13 14:29:07 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-09-13 14:29:07 +0200 |
commit | 7123015dbc961692c0c1d4cd0721f51dcee224bb (patch) | |
tree | 6ffe6f945689e6a8dc10f5041569ba458534b6f6 /src | |
parent | b46735fbafdea562a0d56e7ea1ce844faadcc192 (diff) |
create tables in taler-auditor-sign instead of failing obscurely
Diffstat (limited to 'src')
-rw-r--r-- | src/auditor/taler-auditor-sign.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/auditor/taler-auditor-sign.c b/src/auditor/taler-auditor-sign.c index 5494cd2f5..3fa1d76db 100644 --- a/src/auditor/taler-auditor-sign.c +++ b/src/auditor/taler-auditor-sign.c @@ -196,8 +196,9 @@ main (int argc, argc, argv) < 0) return 1; cfg = GNUNET_CONFIGURATION_create (); - if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg, - cfgfile)) + if (GNUNET_SYSERR == + GNUNET_CONFIGURATION_load (cfg, + cfgfile)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Malformed configuration file `%s', exit ...\n"), @@ -283,7 +284,7 @@ main (int argc, "Denomination list has length zero, signature not produced.\n"); GNUNET_DISK_file_close (fh); GNUNET_free (eddsa_priv); - return 2; + return 2; } if (NULL == (adb = TALER_AUDITORDB_plugin_load (cfg))) @@ -294,7 +295,7 @@ main (int argc, GNUNET_free (eddsa_priv); return 3; } - + kv.purpose.purpose = htonl (TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS); kv.purpose.size = htonl (sizeof (struct TALER_ExchangeKeyValidityPS)); GNUNET_CRYPTO_hash (auditor_url, @@ -355,6 +356,21 @@ main (int argc, GNUNET_free (eddsa_priv); return 1; } + + /* Create required tables */ + if (GNUNET_OK != + adb->create_tables (adb->cls)) + { + fprintf (stderr, + "Failed to create tables in auditor's database\n"); + TALER_AUDITORDB_plugin_unload (adb); + GNUNET_free (dks); + GNUNET_free (sigs); + GNUNET_free (eddsa_priv); + return 3; + } + + /* Update DB */ { enum GNUNET_DB_QueryStatus qs; @@ -389,7 +405,7 @@ main (int argc, return 3; } } - } + } TALER_AUDITORDB_plugin_unload (adb); /* write result to disk */ |