diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-05-08 11:37:37 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-05-08 11:37:37 +0200 |
commit | d3a63881999aa1c6d763263346a0a5979ec6efac (patch) | |
tree | 92f220ad08ce79d1f18366346ffabfa93cf33d75 /src/exchange/taler-exchange-httpd_purses_merge.c | |
parent | 6b8e732bf8d8bfae268e7f5a9a09af9167fd0d47 (diff) |
pass purse_fee to determine how purse creation is paid for
Diffstat (limited to 'src/exchange/taler-exchange-httpd_purses_merge.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_purses_merge.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/src/exchange/taler-exchange-httpd_purses_merge.c b/src/exchange/taler-exchange-httpd_purses_merge.c index a95f4ce4..c2b11ca3 100644 --- a/src/exchange/taler-exchange-httpd_purses_merge.c +++ b/src/exchange/taler-exchange-httpd_purses_merge.c @@ -497,24 +497,32 @@ TEH_handler_purses_merge ( TALER_EC_EXCHANGE_PURSE_MERGE_INVALID_MERGE_SIGNATURE, NULL); } - if (GNUNET_OK != - TALER_wallet_account_merge_verify ( - pcc.merge_timestamp, - pcc.purse_pub, - pcc.purse_expiration, - &pcc.h_contract_terms, - &pcc.target_amount, - pcc.min_age, - &pcc.reserve_pub, - &pcc.reserve_sig)) { - GNUNET_break_op (0); - GNUNET_free (pcc.provider_url); - return TALER_MHD_reply_with_error ( - connection, - MHD_HTTP_BAD_REQUEST, - TALER_EC_EXCHANGE_PURSE_MERGE_INVALID_RESERVE_SIGNATURE, - NULL); + struct TALER_Amount zero_purse_fee; + + TALER_amount_set_zero (pcc.target_amount.currency, + &zero_purse_fee); + if (GNUNET_OK != + TALER_wallet_account_merge_verify ( + pcc.merge_timestamp, + pcc.purse_pub, + pcc.purse_expiration, + &pcc.h_contract_terms, + &pcc.target_amount, + &zero_purse_fee, + pcc.min_age, + TALER_WAMF_MODE_MERGE_FULLY_PAID_PURSE, + &pcc.reserve_pub, + &pcc.reserve_sig)) + { + GNUNET_break_op (0); + GNUNET_free (pcc.provider_url); + return TALER_MHD_reply_with_error ( + connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_EXCHANGE_PURSE_MERGE_INVALID_RESERVE_SIGNATURE, + NULL); + } } /* execute transaction */ |