-fix crash in wirewatch if badly configured
This commit is contained in:
parent
62a6142a8d
commit
ade221f974
@ -225,6 +225,8 @@ shutdown_task (void *cls)
|
|||||||
db_plugin->rollback (db_plugin->cls);
|
db_plugin->rollback (db_plugin->cls);
|
||||||
started_transaction = false;
|
started_transaction = false;
|
||||||
}
|
}
|
||||||
|
if (shard_open)
|
||||||
|
{
|
||||||
qs = db_plugin->abort_shard (db_plugin->cls,
|
qs = db_plugin->abort_shard (db_plugin->cls,
|
||||||
job_name,
|
job_name,
|
||||||
shard_start,
|
shard_start,
|
||||||
@ -232,6 +234,7 @@ shutdown_task (void *cls)
|
|||||||
if (qs <= 0)
|
if (qs <= 0)
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
||||||
"Failed to abort work shard on shutdown\n");
|
"Failed to abort work shard on shutdown\n");
|
||||||
|
}
|
||||||
GNUNET_free (job_name);
|
GNUNET_free (job_name);
|
||||||
if (NULL != ctx)
|
if (NULL != ctx)
|
||||||
{
|
{
|
||||||
@ -327,8 +330,6 @@ exchange_serve_process_config (void)
|
|||||||
{
|
{
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"No wire accounts configured for credit!\n");
|
"No wire accounts configured for credit!\n");
|
||||||
TALER_EXCHANGEDB_plugin_unload (db_plugin);
|
|
||||||
db_plugin = NULL;
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
TALER_EXCHANGEDB_find_accounts (&add_account_cb,
|
TALER_EXCHANGEDB_find_accounts (&add_account_cb,
|
||||||
@ -339,8 +340,6 @@ exchange_serve_process_config (void)
|
|||||||
"No accounts enabled for credit!\n");
|
"No accounts enabled for credit!\n");
|
||||||
GNUNET_SCHEDULER_shutdown ();
|
GNUNET_SCHEDULER_shutdown ();
|
||||||
global_ret = EXIT_INVALIDARGUMENT;
|
global_ret = EXIT_INVALIDARGUMENT;
|
||||||
TALER_EXCHANGEDB_plugin_unload (db_plugin);
|
|
||||||
db_plugin = NULL;
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
@ -1142,6 +1141,11 @@ continue_with_shard (void *cls)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reserve a shard for us to work on.
|
||||||
|
*
|
||||||
|
* @param cls NULL
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
lock_shard (void *cls)
|
lock_shard (void *cls)
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,6 @@ TEH_PG_abort_shard (void *cls,
|
|||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
PREPARE (pg,
|
PREPARE (pg,
|
||||||
"abort_shard",
|
"abort_shard",
|
||||||
"UPDATE work_shards"
|
"UPDATE work_shards"
|
||||||
|
Loading…
Reference in New Issue
Block a user