diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-10-29 20:51:26 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-10-29 20:51:26 +0100 |
commit | 3784541b6c7e178546e91d9cb6579d8643989f59 (patch) | |
tree | db9be98aefc53c63df9df61e827c7f33a4d9d45d /src/testing/testing_api_cmd_deposit.c | |
parent | 9d71f037c015246ff5b2a804771cff9d84eb95dd (diff) | |
download | exchange-3784541b6c7e178546e91d9cb6579d8643989f59.tar.xz |
make replay deposit command not use current time
Diffstat (limited to 'src/testing/testing_api_cmd_deposit.c')
-rw-r--r-- | src/testing/testing_api_cmd_deposit.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c index b7f7c66c5..a80b44868 100644 --- a/src/testing/testing_api_cmd_deposit.c +++ b/src/testing/testing_api_cmd_deposit.c @@ -313,6 +313,22 @@ deposit_run (void *cls, return; } ds->is = is; + if (! GNUNET_TIME_absolute_is_zero (ds->refund_deadline.abs_time)) + { + struct GNUNET_TIME_Relative refund_deadline; + + refund_deadline + = GNUNET_TIME_absolute_get_remaining (ds->refund_deadline.abs_time); + ds->wire_deadline + = GNUNET_TIME_relative_to_timestamp ( + GNUNET_TIME_relative_multiply (refund_deadline, + 2)); + } + else + { + ds->refund_deadline = ds->wallet_timestamp; + ds->wire_deadline = GNUNET_TIME_timestamp_get (); + } if (NULL != ds->deposit_reference) { /* We're copying another deposit operation, initialize here. */ @@ -335,6 +351,7 @@ deposit_run (void *cls, ds->contract_terms = json_incref (ods->contract_terms); ds->wallet_timestamp = ods->wallet_timestamp; ds->refund_deadline = ods->refund_deadline; + ds->wire_deadline = ods->wire_deadline; ds->amount = ods->amount; ds->merchant_priv = ods->merchant_priv; ds->command_initialized = GNUNET_YES; @@ -415,23 +432,6 @@ deposit_run (void *cls, GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv->eddsa_priv, &coin_pub.eddsa_pub); - if (! GNUNET_TIME_absolute_is_zero (ds->refund_deadline.abs_time)) - { - struct GNUNET_TIME_Relative refund_deadline; - - refund_deadline - = GNUNET_TIME_absolute_get_remaining (ds->refund_deadline.abs_time); - ds->wire_deadline - = - GNUNET_TIME_relative_to_timestamp ( - GNUNET_TIME_relative_multiply (refund_deadline, - 2)); - } - else - { - ds->refund_deadline = ds->wallet_timestamp; - ds->wire_deadline = ds->wallet_timestamp; - } GNUNET_CRYPTO_eddsa_key_get_public (&ds->merchant_priv.eddsa_priv, &merchant_pub.eddsa_pub); { |