check h_wire/wire consistency

This commit is contained in:
Christian Grothoff 2019-09-03 04:16:28 +02:00
parent 380bf67de6
commit 05b92c2431
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -2071,6 +2071,28 @@ check_transaction_history_for_deposit (const struct
switch (tl->type) switch (tl->type)
{ {
case TALER_EXCHANGEDB_TT_DEPOSIT: case TALER_EXCHANGEDB_TT_DEPOSIT:
/* check wire and h_wire are consistent */
{
struct GNUNET_HashCode hw;
if (GNUNET_OK !=
TALER_JSON_merchant_wire_signature_hash (
tl->details.deposit->receiver_wire_account,
&hw))
{
report_row_inconsistency ("deposits",
tl->serial_id,
"wire value malformed");
}
else if (0 !=
GNUNET_memcmp (&hw,
&tl->details.deposit->h_wire))
{
report_row_inconsistency ("deposits",
tl->serial_id,
"h_wire does not match wire");
}
}
amount_with_fee = &tl->details.deposit->amount_with_fee; amount_with_fee = &tl->details.deposit->amount_with_fee;
fee = &tl->details.deposit->deposit_fee; fee = &tl->details.deposit->deposit_fee;
fee_dki = &dki->properties.fee_deposit; fee_dki = &dki->properties.fee_deposit;