aboutsummaryrefslogtreecommitdiff
path: root/src/exchange-lib/exchange_api_reserve.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-05-26 16:38:59 +0200
committerChristian Grothoff <christian@grothoff.org>2016-05-26 16:38:59 +0200
commitc0451f0982bdb565f431417cea3ab0238342d125 (patch)
tree4a27b418a74acd0fa5d6bb789818ced43c4832d5 /src/exchange-lib/exchange_api_reserve.c
parent3f468773e71b68e9ceb5431e797941b1cc086e68 (diff)
downloadexchange-c0451f0982bdb565f431417cea3ab0238342d125.tar.xz
fix #4533 for exchange (breaks interaction with bank for /admin/add/incoming)
Diffstat (limited to 'src/exchange-lib/exchange_api_reserve.c')
-rw-r--r--src/exchange-lib/exchange_api_reserve.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/exchange-lib/exchange_api_reserve.c b/src/exchange-lib/exchange_api_reserve.c
index 9c0314d0f..ab8733dbb 100644
--- a/src/exchange-lib/exchange_api_reserve.c
+++ b/src/exchange-lib/exchange_api_reserve.c
@@ -135,7 +135,8 @@ parse_reserve_history (const json_t *history,
if (0 == strcasecmp (type,
"DEPOSIT"))
{
- json_t *wire;
+ json_t *wire_account;
+ json_t *transfer;
rhistory[off].type = TALER_EXCHANGE_RTT_DEPOSIT;
if (GNUNET_OK !=
@@ -147,18 +148,33 @@ parse_reserve_history (const json_t *history,
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- wire = json_object_get (transaction,
- "wire");
- /* check 'wire' is a JSON object (no need to check wireformat,
+ wire_account = json_object_get (transaction,
+ "sender_account_details");
+ /* check 'wire_account' is a JSON object (no need to check wireformat,
but we do at least expect "some" JSON object here) */
- if ( (NULL == wire) ||
- (! json_is_object (wire)) )
+ if ( (NULL == wire_account) ||
+ (! json_is_object (wire_account)) )
{
/* not even a JSON 'wire' specification, not acceptable */
GNUNET_break_op (0);
+ if (NULL != wire_account)
+ json_decref (wire_account);
return GNUNET_SYSERR;
}
- rhistory[off].details.wire_in_details = wire;
+ transfer = json_object_get (transaction,
+ "transfer_details");
+ /* check 'transfer' is a JSON object */
+ if ( (NULL == transfer) ||
+ (! json_is_object (transfer)) )
+ {
+ GNUNET_break_op (0);
+ json_decref (wire_account);
+ if (NULL != transfer)
+ json_decref (transfer);
+ return GNUNET_SYSERR;
+ }
+ rhistory[off].details.in_details.sender_account_details = wire_account;
+ rhistory[off].details.in_details.transfer_details = transfer;
/* end type==DEPOSIT */
}
else if (0 == strcasecmp (type,