add reserve-open-deposit transactions to coin histories
This commit is contained in:
parent
1ee69f6f1d
commit
5f333f817c
@ -99,7 +99,6 @@ static struct Table tables[] = {
|
|||||||
{ .rt = TALER_EXCHANGEDB_RT_RESERVES_CLOSE},
|
{ .rt = TALER_EXCHANGEDB_RT_RESERVES_CLOSE},
|
||||||
{ .rt = TALER_EXCHANGEDB_RT_RESERVES_OPEN_REQUESTS},
|
{ .rt = TALER_EXCHANGEDB_RT_RESERVES_OPEN_REQUESTS},
|
||||||
{ .rt = TALER_EXCHANGEDB_RT_RESERVES_OPEN_DEPOSITS},
|
{ .rt = TALER_EXCHANGEDB_RT_RESERVES_OPEN_DEPOSITS},
|
||||||
{ .rt = TALER_EXCHANGEDB_RT_RESERVES_CLOSE_REQUESTS},
|
|
||||||
{ .rt = TALER_EXCHANGEDB_RT_RESERVES_OUT},
|
{ .rt = TALER_EXCHANGEDB_RT_RESERVES_OUT},
|
||||||
{ .rt = TALER_EXCHANGEDB_RT_AUDITORS},
|
{ .rt = TALER_EXCHANGEDB_RT_AUDITORS},
|
||||||
{ .rt = TALER_EXCHANGEDB_RT_AUDITOR_DENOM_SIGS},
|
{ .rt = TALER_EXCHANGEDB_RT_AUDITOR_DENOM_SIGS},
|
||||||
|
@ -424,6 +424,31 @@ TEH_RESPONSE_compile_transaction_history (
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case TALER_EXCHANGEDB_TT_RESERVE_OPEN:
|
||||||
|
{
|
||||||
|
struct TALER_EXCHANGEDB_ReserveOpenListEntry *role
|
||||||
|
= pos->details.reserve_open;
|
||||||
|
|
||||||
|
if (0 !=
|
||||||
|
json_array_append_new (
|
||||||
|
history,
|
||||||
|
GNUNET_JSON_PACK (
|
||||||
|
GNUNET_JSON_pack_string ("type",
|
||||||
|
"RESERVE-OPEN-DEPOSIT"),
|
||||||
|
TALER_JSON_pack_amount ("coin_contribution",
|
||||||
|
&role->coin_contribution),
|
||||||
|
GNUNET_JSON_pack_data_auto ("reserve_sig",
|
||||||
|
&role->reserve_sig),
|
||||||
|
GNUNET_JSON_pack_data_auto ("coin_sig",
|
||||||
|
&role->coin_sig))))
|
||||||
|
{
|
||||||
|
GNUNET_break (0);
|
||||||
|
json_decref (history);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return history;
|
return history;
|
||||||
|
@ -131,6 +131,17 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
|
|||||||
}
|
}
|
||||||
deposit_fee = pos->details.purse_deposit->deposit_fee;
|
deposit_fee = pos->details.purse_deposit->deposit_fee;
|
||||||
break;
|
break;
|
||||||
|
case TALER_EXCHANGEDB_TT_RESERVE_OPEN:
|
||||||
|
/* spent += pos->amount_with_fee */
|
||||||
|
if (0 >
|
||||||
|
TALER_amount_add (&spent,
|
||||||
|
&spent,
|
||||||
|
&pos->details.reserve_open->coin_contribution))
|
||||||
|
{
|
||||||
|
GNUNET_break (0);
|
||||||
|
return GNUNET_SYSERR;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (have_refund)
|
if (have_refund)
|
||||||
|
@ -152,6 +152,14 @@ TEH_COMMON_free_coin_transaction_list (
|
|||||||
GNUNET_free (deposit);
|
GNUNET_free (deposit);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case TALER_EXCHANGEDB_TT_RESERVE_OPEN:
|
||||||
|
{
|
||||||
|
struct TALER_EXCHANGEDB_ReserveOpenListEntry *role;
|
||||||
|
|
||||||
|
role = tl->details.reserve_open;
|
||||||
|
GNUNET_free (role);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
struct TALER_EXCHANGEDB_TransactionList *next;
|
struct TALER_EXCHANGEDB_TransactionList *next;
|
||||||
|
Loading…
Reference in New Issue
Block a user