-work on p2p payments
This commit is contained in:
parent
b7a4fd401e
commit
345c141bad
@ -2257,6 +2257,9 @@ global_fee_info_cb (
|
|||||||
struct TEH_KeyStateHandle *ksh = cls;
|
struct TEH_KeyStateHandle *ksh = cls;
|
||||||
struct TEH_GlobalFee *gf;
|
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 = GNUNET_new (struct TEH_GlobalFee);
|
||||||
gf->start_date = start_date;
|
gf->start_date = start_date;
|
||||||
gf->end_date = end_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,
|
qs = TEH_plugin->get_global_fees (TEH_plugin->cls,
|
||||||
&global_fee_info_cb,
|
&global_fee_info_cb,
|
||||||
ksh);
|
ksh);
|
||||||
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
|
"Loading global fees from DB: %d\n",
|
||||||
|
qs);
|
||||||
if (qs < 0)
|
if (qs < 0)
|
||||||
{
|
{
|
||||||
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR != qs);
|
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR != qs);
|
||||||
|
@ -496,7 +496,8 @@ parse_coin (struct MHD_Connection *connection,
|
|||||||
&coin->cpi.coin_pub,
|
&coin->cpi.coin_pub,
|
||||||
&coin->coin_sig))
|
&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);
|
GNUNET_JSON_parse_free (spec);
|
||||||
return (MHD_YES ==
|
return (MHD_YES ==
|
||||||
TALER_MHD_reply_with_error (connection,
|
TALER_MHD_reply_with_error (connection,
|
||||||
|
@ -8535,7 +8535,10 @@ postgres_get_global_fees (void *cls,
|
|||||||
{
|
{
|
||||||
struct PostgresClosure *pg = cls;
|
struct PostgresClosure *pg = cls;
|
||||||
struct GNUNET_TIME_Timestamp date
|
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[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_timestamp (&date),
|
GNUNET_PQ_query_param_timestamp (&date),
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
|
@ -329,11 +329,15 @@ TALER_EXCHANGE_purse_create_with_deposit (
|
|||||||
GNUNET_assert (NULL != deposit_arr);
|
GNUNET_assert (NULL != deposit_arr);
|
||||||
url = TEAH_path_to_url (exchange,
|
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++)
|
for (unsigned int i = 0; i<num_deposits; i++)
|
||||||
{
|
{
|
||||||
const struct TALER_EXCHANGE_PurseDeposit *deposit = &deposits[i];
|
const struct TALER_EXCHANGE_PurseDeposit *deposit = &deposits[i];
|
||||||
json_t *jdeposit;
|
json_t *jdeposit;
|
||||||
struct TALER_CoinSpendSignatureP coin_sig;
|
struct TALER_CoinSpendSignatureP coin_sig;
|
||||||
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
#if FIXME_OEC
|
#if FIXME_OEC
|
||||||
struct TALER_AgeCommitmentHash agh;
|
struct TALER_AgeCommitmentHash agh;
|
||||||
struct TALER_AgeCommitmentHash *aghp = NULL;
|
struct TALER_AgeCommitmentHash *aghp = NULL;
|
||||||
@ -354,6 +358,8 @@ TALER_EXCHANGE_purse_create_with_deposit (
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
GNUNET_CRYPTO_eddsa_key_get_public (&deposit->coin_priv.eddsa_priv,
|
||||||
|
&coin_pub.eddsa_pub);
|
||||||
TALER_wallet_purse_deposit_sign (
|
TALER_wallet_purse_deposit_sign (
|
||||||
url,
|
url,
|
||||||
&pch->purse_pub,
|
&pch->purse_pub,
|
||||||
@ -376,7 +382,9 @@ TALER_EXCHANGE_purse_create_with_deposit (
|
|||||||
TALER_JSON_pack_denom_sig ("ub_sig",
|
TALER_JSON_pack_denom_sig ("ub_sig",
|
||||||
&deposit->denom_sig),
|
&deposit->denom_sig),
|
||||||
GNUNET_JSON_pack_data_auto ("coin_sig",
|
GNUNET_JSON_pack_data_auto ("coin_sig",
|
||||||
&coin_sig));
|
&coin_sig),
|
||||||
|
GNUNET_JSON_pack_data_auto ("coin_pub",
|
||||||
|
&coin_pub));
|
||||||
GNUNET_assert (0 ==
|
GNUNET_assert (0 ==
|
||||||
json_array_append_new (deposit_arr,
|
json_array_append_new (deposit_arr,
|
||||||
jdeposit));
|
jdeposit));
|
||||||
|
@ -1251,7 +1251,7 @@ TALER_wallet_econtract_upload_verify (
|
|||||||
GNUNET_CRYPTO_hash (econtract,
|
GNUNET_CRYPTO_hash (econtract,
|
||||||
econtract_size,
|
econtract_size,
|
||||||
&pc.h_econtract);
|
&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,
|
&pc.purpose,
|
||||||
&purse_sig->eddsa_signature,
|
&purse_sig->eddsa_signature,
|
||||||
&purse_pub->eddsa_pub);
|
&purse_pub->eddsa_pub);
|
||||||
|
Loading…
Reference in New Issue
Block a user