diff options
Diffstat (limited to 'src/backend/taler-merchant-exchange.c')
-rw-r--r-- | src/backend/taler-merchant-exchange.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/backend/taler-merchant-exchange.c b/src/backend/taler-merchant-exchange.c index 4db8f92d..bc475031 100644 --- a/src/backend/taler-merchant-exchange.c +++ b/src/backend/taler-merchant-exchange.c @@ -613,14 +613,18 @@ check_wire_fee (struct Inquiry *w, case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: break; } - if (0 <= TALER_amount_cmp (&fees.wire, - wire_fee)) + if ( (GNUNET_OK != + TALER_amount_cmp_currency (&fees.wire, + wire_fee)) || + (0 > TALER_amount_cmp (&fees.wire, + wire_fee)) ) { + GNUNET_break_op (0); GNUNET_free (wire_method); - return GNUNET_OK; /* expected_fee >= wire_fee */ + return GNUNET_SYSERR; /* expected_fee >= wire_fee */ } GNUNET_free (wire_method); - return GNUNET_SYSERR; + return GNUNET_OK; } @@ -698,8 +702,14 @@ check_transfer (void *cls, GNUNET_break (0); return; /* already had a serious issue; odd that we're called more than once as well... */ } - if ( (0 != TALER_amount_cmp (amount_with_fee, + if ( (GNUNET_OK != + TALER_amount_cmp_currency (amount_with_fee, + &ttd->coin_value)) || + (0 != TALER_amount_cmp (amount_with_fee, &ttd->coin_value)) || + (GNUNET_OK != + TALER_amount_cmp_currency (deposit_fee, + &ttd->coin_fee)) || (0 != TALER_amount_cmp (deposit_fee, &ttd->coin_fee)) ) { @@ -905,9 +915,12 @@ wire_transfer_cb (void *cls, return; } - if (0 != - TALER_amount_cmp (&td->total_amount, - &w->total)) + if ( (GNUNET_OK != + TALER_amount_cmp_currency (&td->total_amount, + &w->total)) || + (0 != + TALER_amount_cmp (&td->total_amount, + &w->total)) ) { GNUNET_break_op (0); update_transaction_status (w, |