refuse endian conversion for invalid amounts
This commit is contained in:
parent
4f2ad1051b
commit
2d08d612f6
@ -207,6 +207,8 @@ void
|
||||
TALER_amount_hton (struct TALER_AmountNBO *res,
|
||||
const struct TALER_Amount *d)
|
||||
{
|
||||
GNUNET_assert (GNUNET_YES ==
|
||||
TALER_amount_is_valid (d));
|
||||
res->value = GNUNET_htonll (d->value);
|
||||
res->fraction = htonl (d->fraction);
|
||||
memcpy (res->currency,
|
||||
@ -230,6 +232,8 @@ TALER_amount_ntoh (struct TALER_Amount *res,
|
||||
memcpy (res->currency,
|
||||
dn->currency,
|
||||
TALER_CURRENCY_LEN);
|
||||
GNUNET_assert (GNUNET_YES ==
|
||||
TALER_amount_is_valid (res));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user