initialize melt_fee in the TALER_MINT_RefreshMelt struct
This commit is contained in:
parent
e08f479eb4
commit
cf3345a96f
@ -582,6 +582,7 @@ refresh_accept_melts (struct MHD_Connection *connection,
|
|||||||
melt.coin_sig = coin_details->melt_sig;
|
melt.coin_sig = coin_details->melt_sig;
|
||||||
melt.session_hash = *session_hash;
|
melt.session_hash = *session_hash;
|
||||||
melt.amount_with_fee = coin_details->melt_amount_with_fee;
|
melt.amount_with_fee = coin_details->melt_amount_with_fee;
|
||||||
|
melt.melt_fee = coin_details->melt_fee;
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->insert_refresh_melt (TMH_plugin->cls,
|
TMH_plugin->insert_refresh_melt (TMH_plugin->cls,
|
||||||
session,
|
session,
|
||||||
|
@ -99,6 +99,12 @@ struct TMH_DB_MeltDetails
|
|||||||
* to the melt is this value minus the fee for melting the coin.
|
* to the melt is this value minus the fee for melting the coin.
|
||||||
*/
|
*/
|
||||||
struct TALER_Amount melt_amount_with_fee;
|
struct TALER_Amount melt_amount_with_fee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* What fee is earned by the mint? Set delayed during
|
||||||
|
* #verify_coin_public_info().
|
||||||
|
*/
|
||||||
|
struct TALER_Amount melt_fee;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -223,7 +223,8 @@ get_coin_public_info (struct MHD_Connection *connection,
|
|||||||
*
|
*
|
||||||
* @param connection the connection to send error responses to
|
* @param connection the connection to send error responses to
|
||||||
* @param session_hash hash over refresh session the coin is melted into
|
* @param session_hash hash over refresh session the coin is melted into
|
||||||
* @param melt_detail details about the coin's melting permission (if valid)
|
* @param[in,out] melt_detail details about the coin's melting permission,
|
||||||
|
* the `melt_fee` is updated
|
||||||
* @return #GNUNET_YES if coin public info in JSON was valid
|
* @return #GNUNET_YES if coin public info in JSON was valid
|
||||||
* #GNUNET_NO JSON was invalid, response was generated
|
* #GNUNET_NO JSON was invalid, response was generated
|
||||||
* #GNUNET_SYSERR on internal error
|
* #GNUNET_SYSERR on internal error
|
||||||
@ -231,7 +232,7 @@ get_coin_public_info (struct MHD_Connection *connection,
|
|||||||
static int
|
static int
|
||||||
verify_coin_public_info (struct MHD_Connection *connection,
|
verify_coin_public_info (struct MHD_Connection *connection,
|
||||||
const struct GNUNET_HashCode *session_hash,
|
const struct GNUNET_HashCode *session_hash,
|
||||||
const struct TMH_DB_MeltDetails *melt_detail)
|
struct TMH_DB_MeltDetails *melt_detail)
|
||||||
{
|
{
|
||||||
struct TALER_RefreshMeltCoinAffirmationPS body;
|
struct TALER_RefreshMeltCoinAffirmationPS body;
|
||||||
struct TMH_KS_StateHandle *key_state;
|
struct TMH_KS_StateHandle *key_state;
|
||||||
@ -253,6 +254,7 @@ verify_coin_public_info (struct MHD_Connection *connection,
|
|||||||
valid for issuing! (#3634) */
|
valid for issuing! (#3634) */
|
||||||
TALER_amount_ntoh (&fee_refresh,
|
TALER_amount_ntoh (&fee_refresh,
|
||||||
&dki->issue.properties.fee_refresh);
|
&dki->issue.properties.fee_refresh);
|
||||||
|
melt_detail->melt_fee = fee_refresh;
|
||||||
body.purpose.size = htonl (sizeof (struct TALER_RefreshMeltCoinAffirmationPS));
|
body.purpose.size = htonl (sizeof (struct TALER_RefreshMeltCoinAffirmationPS));
|
||||||
body.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_MELT);
|
body.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_MELT);
|
||||||
body.session_hash = *session_hash;
|
body.session_hash = *session_hash;
|
||||||
|
Loading…
Reference in New Issue
Block a user