allow skipping of denom fees check

This commit is contained in:
Florian Dold 2020-01-18 13:52:10 +01:00
parent ccb8869344
commit 4993863c4c
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
2 changed files with 42 additions and 33 deletions

View File

@ -149,7 +149,7 @@ TALER_BANK_auth_free (struct TALER_BANK_AuthenticationData *auth)
break; break;
} }
GNUNET_free (auth->wire_gateway_url); GNUNET_free (auth->wire_gateway_url);
auth->wire_gateway_rul = NULL; auth->wire_gateway_url = NULL;
} }

View File

@ -136,18 +136,21 @@ TALER_EXCHANGE_verify_coin_history (const struct
GNUNET_break_op (0); GNUNET_break_op (0);
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
/* check that deposit fee matches our expectations from /keys! */ if (NULL != dk)
TALER_amount_ntoh (&fee,
&dr.deposit_fee);
if ( (GNUNET_YES !=
TALER_amount_cmp_currency (&fee,
&dk->fee_deposit)) ||
(0 !=
TALER_amount_cmp (&fee,
&dk->fee_deposit)) )
{ {
GNUNET_break_op (0); /* check that deposit fee matches our expectations from /keys! */
return GNUNET_SYSERR; TALER_amount_ntoh (&fee,
&dr.deposit_fee);
if ( (GNUNET_YES !=
TALER_amount_cmp_currency (&fee,
&dk->fee_deposit)) ||
(0 !=
TALER_amount_cmp (&fee,
&dk->fee_deposit)) )
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
} }
add = GNUNET_YES; add = GNUNET_YES;
} }
@ -188,18 +191,21 @@ TALER_EXCHANGE_verify_coin_history (const struct
GNUNET_break_op (0); GNUNET_break_op (0);
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
/* check that melt fee matches our expectations from /keys! */ if (NULL != dk)
TALER_amount_ntoh (&fee,
&rm.melt_fee);
if ( (GNUNET_YES !=
TALER_amount_cmp_currency (&fee,
&dk->fee_refresh)) ||
(0 !=
TALER_amount_cmp (&fee,
&dk->fee_refresh)) )
{ {
GNUNET_break_op (0); /* check that melt fee matches our expectations from /keys! */
return GNUNET_SYSERR; TALER_amount_ntoh (&fee,
&rm.melt_fee);
if ( (GNUNET_YES !=
TALER_amount_cmp_currency (&fee,
&dk->fee_refresh)) ||
(0 !=
TALER_amount_cmp (&fee,
&dk->fee_refresh)) )
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
} }
add = GNUNET_YES; add = GNUNET_YES;
} }
@ -253,17 +259,20 @@ TALER_EXCHANGE_verify_coin_history (const struct
well-formendess check). */// well-formendess check). *///
/* check that refund fee matches our expectations from /keys! */ /* check that refund fee matches our expectations from /keys! */
TALER_amount_ntoh (&fee, if (NULL != dk)
&rr.refund_fee);
if ( (GNUNET_YES !=
TALER_amount_cmp_currency (&fee,
&dk->fee_refund)) ||
(0 !=
TALER_amount_cmp (&fee,
&dk->fee_refund)) )
{ {
GNUNET_break_op (0); TALER_amount_ntoh (&fee,
return GNUNET_SYSERR; &rr.refund_fee);
if ( (GNUNET_YES !=
TALER_amount_cmp_currency (&fee,
&dk->fee_refund)) ||
(0 !=
TALER_amount_cmp (&fee,
&dk->fee_refund)) )
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
} }
add = GNUNET_NO; add = GNUNET_NO;
} }