-work on p2p payments

This commit is contained in:
Christian Grothoff 2022-04-23 20:50:27 +02:00
parent b7a4fd401e
commit 345c141bad
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
5 changed files with 22 additions and 4 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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

View File

@ -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; i<num_deposits; i++)
{
const struct TALER_EXCHANGE_PurseDeposit *deposit = &deposits[i];
json_t *jdeposit;
struct TALER_CoinSpendSignatureP coin_sig;
struct TALER_CoinSpendPublicKeyP coin_pub;
#if FIXME_OEC
struct TALER_AgeCommitmentHash agh;
struct TALER_AgeCommitmentHash *aghp = NULL;
@ -354,6 +358,8 @@ TALER_EXCHANGE_purse_create_with_deposit (
return NULL;
}
#endif
GNUNET_CRYPTO_eddsa_key_get_public (&deposit->coin_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));

View File

@ -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);