keyup:_use_ the timestamp given by the user.
This commit is contained in:
parent
8d979a92c9
commit
9d37f8e026
@ -195,11 +195,17 @@ static char *feedir;
|
|||||||
static const struct GNUNET_CONFIGURATION_Handle *kcfg;
|
static const struct GNUNET_CONFIGURATION_Handle *kcfg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time when the key update is executed. Either the actual current time, or a
|
* Time when the key update is executed.
|
||||||
* pretended time.
|
* Either the actual current time, or a pretended time.
|
||||||
*/
|
*/
|
||||||
static struct GNUNET_TIME_Absolute now;
|
static struct GNUNET_TIME_Absolute now;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The time for the key update, as passed by the user
|
||||||
|
* on the command line.
|
||||||
|
*/
|
||||||
|
static struct GNUNET_TIME_Absolute now_tmp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Master private key of the exchange.
|
* Master private key of the exchange.
|
||||||
*/
|
*/
|
||||||
@ -726,6 +732,12 @@ get_cointype_params (const char *ct,
|
|||||||
params->duration_withdraw,
|
params->duration_withdraw,
|
||||||
params->duration_overlap,
|
params->duration_overlap,
|
||||||
¶ms->anchor);
|
¶ms->anchor);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The "anchor" is merely the latest denom key filename
|
||||||
|
* converted to a GNUnet absolute date.
|
||||||
|
*/
|
||||||
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -809,6 +821,7 @@ exchange_keys_update_cointype (void *cls,
|
|||||||
*ret = GNUNET_SYSERR;
|
*ret = GNUNET_SYSERR;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/* p has the right anchor now = latest denom filename converted to time. */
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_DISK_directory_create (get_cointype_dir (&p)))
|
GNUNET_DISK_directory_create (get_cointype_dir (&p)))
|
||||||
{
|
{
|
||||||
@ -1179,6 +1192,15 @@ run (void *cls,
|
|||||||
struct GNUNET_CRYPTO_EddsaPrivateKey *eddsa_priv;
|
struct GNUNET_CRYPTO_EddsaPrivateKey *eddsa_priv;
|
||||||
|
|
||||||
kcfg = cfg;
|
kcfg = cfg;
|
||||||
|
|
||||||
|
if (now.abs_value_us != now_tmp.abs_value_us)
|
||||||
|
{
|
||||||
|
/* The user gave "--now", use it */
|
||||||
|
now = now_tmp;
|
||||||
|
}
|
||||||
|
/* The user _might_ have given "--now" but it matched
|
||||||
|
* exactly the normal now, so no change required. */
|
||||||
|
|
||||||
if (NULL == feedir)
|
if (NULL == feedir)
|
||||||
{
|
{
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -1387,7 +1409,7 @@ main (int argc,
|
|||||||
"time",
|
"time",
|
||||||
"TIMESTAMP",
|
"TIMESTAMP",
|
||||||
"pretend it is a different time for the update",
|
"pretend it is a different time for the update",
|
||||||
&now),
|
&now_tmp),
|
||||||
GNUNET_GETOPT_OPTION_END
|
GNUNET_GETOPT_OPTION_END
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1395,7 +1417,7 @@ main (int argc,
|
|||||||
GNUNET_log_setup ("taler-exchange-keyup",
|
GNUNET_log_setup ("taler-exchange-keyup",
|
||||||
"WARNING",
|
"WARNING",
|
||||||
NULL));
|
NULL));
|
||||||
now = GNUNET_TIME_absolute_get ();
|
now = now_tmp = GNUNET_TIME_absolute_get ();
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_PROGRAM_run (argc, argv,
|
GNUNET_PROGRAM_run (argc, argv,
|
||||||
"taler-exchange-keyup",
|
"taler-exchange-keyup",
|
||||||
|
@ -58,7 +58,7 @@ struct CheckKeysState
|
|||||||
/**
|
/**
|
||||||
* If GNUNET_YES, then the user must specify the
|
* If GNUNET_YES, then the user must specify the
|
||||||
* last_denom_issue_date manually. This way, it is possible
|
* last_denom_issue_date manually. This way, it is possible
|
||||||
* to force whatever X value here: /keys?last_denom_issue=X.
|
* to force whatever X value here (including 0): /keys?last_denom_issue=X.
|
||||||
*/
|
*/
|
||||||
unsigned int set_last_denom;
|
unsigned int set_last_denom;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user