From 345c141bad275828b35a4299a44e9d357998d6a4 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 23 Apr 2022 20:50:27 +0200 Subject: -work on p2p payments --- src/exchange/taler-exchange-httpd_keys.c | 6 ++++++ src/exchange/taler-exchange-httpd_purses_create.c | 3 ++- src/exchangedb/plugin_exchangedb_postgres.c | 5 ++++- src/lib/exchange_api_purse_create_with_deposit.c | 10 +++++++++- src/util/wallet_signatures.c | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c index e0ca24a65..7aff0903b 100644 --- a/src/exchange/taler-exchange-httpd_keys.c +++ b/src/exchange/taler-exchange-httpd_keys.c @@ -2257,6 +2257,9 @@ global_fee_info_cb ( struct TEH_KeyStateHandle *ksh = cls; struct TEH_GlobalFee *gf; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Found global fees with %u purses\n", + purse_account_limit); gf = GNUNET_new (struct TEH_GlobalFee); gf->start_date = start_date; gf->end_date = end_date; @@ -2343,6 +2346,9 @@ build_key_state (struct HelperState *hs, qs = TEH_plugin->get_global_fees (TEH_plugin->cls, &global_fee_info_cb, ksh); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Loading global fees from DB: %d\n", + qs); if (qs < 0) { GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR != qs); diff --git a/src/exchange/taler-exchange-httpd_purses_create.c b/src/exchange/taler-exchange-httpd_purses_create.c index f4f00bb23..ef1189530 100644 --- a/src/exchange/taler-exchange-httpd_purses_create.c +++ b/src/exchange/taler-exchange-httpd_purses_create.c @@ -496,7 +496,8 @@ parse_coin (struct MHD_Connection *connection, &coin->cpi.coin_pub, &coin->coin_sig)) { - TALER_LOG_WARNING ("Invalid signature on /purses/$PID/create request\n"); + TALER_LOG_WARNING ( + "Invalid coin signature on /purses/$PID/create request\n"); GNUNET_JSON_parse_free (spec); return (MHD_YES == TALER_MHD_reply_with_error (connection, diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index ff2dcbf42..93d71e594 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -8535,7 +8535,10 @@ postgres_get_global_fees (void *cls, { struct PostgresClosure *pg = cls; struct GNUNET_TIME_Timestamp date - = GNUNET_TIME_timestamp_get (); + = GNUNET_TIME_absolute_to_timestamp ( + GNUNET_TIME_absolute_subtract ( + GNUNET_TIME_absolute_get (), + GNUNET_TIME_UNIT_YEARS)); struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_timestamp (&date), GNUNET_PQ_query_param_end diff --git a/src/lib/exchange_api_purse_create_with_deposit.c b/src/lib/exchange_api_purse_create_with_deposit.c index 48b9aad78..f6f8c2d86 100644 --- a/src/lib/exchange_api_purse_create_with_deposit.c +++ b/src/lib/exchange_api_purse_create_with_deposit.c @@ -329,11 +329,15 @@ TALER_EXCHANGE_purse_create_with_deposit ( GNUNET_assert (NULL != deposit_arr); url = TEAH_path_to_url (exchange, "/"); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Signing with URL `%s'\n", + url); for (unsigned int i = 0; icoin_priv.eddsa_priv, + &coin_pub.eddsa_pub); TALER_wallet_purse_deposit_sign ( url, &pch->purse_pub, @@ -376,7 +382,9 @@ TALER_EXCHANGE_purse_create_with_deposit ( TALER_JSON_pack_denom_sig ("ub_sig", &deposit->denom_sig), GNUNET_JSON_pack_data_auto ("coin_sig", - &coin_sig)); + &coin_sig), + GNUNET_JSON_pack_data_auto ("coin_pub", + &coin_pub)); GNUNET_assert (0 == json_array_append_new (deposit_arr, jdeposit)); diff --git a/src/util/wallet_signatures.c b/src/util/wallet_signatures.c index 5b98f46e4..f0ff2dc89 100644 --- a/src/util/wallet_signatures.c +++ b/src/util/wallet_signatures.c @@ -1251,7 +1251,7 @@ TALER_wallet_econtract_upload_verify ( GNUNET_CRYPTO_hash (econtract, econtract_size, &pc.h_econtract); - return GNUNET_CRYPTO_eddsa_verify_ (TALER_SIGNATURE_WALLET_RESERVE_CLOSE, + return GNUNET_CRYPTO_eddsa_verify_ (TALER_SIGNATURE_WALLET_PURSE_ECONTRACT, &pc.purpose, &purse_sig->eddsa_signature, &purse_pub->eddsa_pub); -- cgit v1.2.3