diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-03-22 16:20:03 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-03-22 16:20:03 +0100 |
commit | 41478aea76fdcbd11f0fb2225aae4b184053ab5f (patch) | |
tree | 326e5ee7bebe70b02bc3352b1539e2f92aa511ac /src/mint/taler-mint-httpd_db.c | |
parent | 3fe9a76098607656d95b6d9843dc77bc948a46a2 (diff) | |
download | exchange-41478aea76fdcbd11f0fb2225aae4b184053ab5f.tar.xz |
move deposit fee check to earlier
Diffstat (limited to 'src/mint/taler-mint-httpd_db.c')
-rw-r--r-- | src/mint/taler-mint-httpd_db.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/mint/taler-mint-httpd_db.c b/src/mint/taler-mint-httpd_db.c index f99a98598..43b226e64 100644 --- a/src/mint/taler-mint-httpd_db.c +++ b/src/mint/taler-mint-httpd_db.c @@ -105,7 +105,6 @@ TALER_MINT_db_execute_deposit (struct MHD_Connection *connection, struct TALER_MINT_DB_TransactionList *tl; struct TALER_Amount spent; struct TALER_Amount value; - struct TALER_Amount fee_deposit; struct MintKeyState *mks; struct TALER_MINT_DenomKeyIssuePriv *dki; int ret; @@ -134,8 +133,6 @@ TALER_MINT_db_execute_deposit (struct MHD_Connection *connection, deposit->coin.denom_pub); TALER_amount_ntoh (&value, &dki->issue.value); - TALER_amount_ntoh (&fee_deposit, - &dki->issue.fee_deposit); TALER_MINT_key_state_release (mks); if (GNUNET_OK != @@ -147,14 +144,6 @@ TALER_MINT_db_execute_deposit (struct MHD_Connection *connection, } /* fee for THIS transaction */ spent = deposit->amount_with_fee; - if (TALER_amount_cmp (&fee_deposit, - &spent) < 0) - { - return (MHD_YES == - TALER_MINT_reply_external_error (connection, - "deposited amount smaller than depositing fee")) - ? GNUNET_NO : GNUNET_SYSERR; - } /* add cost of all previous transactions */ tl = plugin->get_coin_transactions (plugin->cls, session, @@ -168,6 +157,8 @@ TALER_MINT_db_execute_deposit (struct MHD_Connection *connection, tl); return TALER_MINT_reply_internal_db_error (connection); } + /* Check that cost of all transactions is smaller than + the value of the coin. */ if (0 < TALER_amount_cmp (&spent, &value)) { |