diff options
Diffstat (limited to 'src/mint/taler-mint-httpd_refresh.c')
-rw-r--r-- | src/mint/taler-mint-httpd_refresh.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/mint/taler-mint-httpd_refresh.c b/src/mint/taler-mint-httpd_refresh.c index 3751ee17d..2030eb3d6 100644 --- a/src/mint/taler-mint-httpd_refresh.c +++ b/src/mint/taler-mint-httpd_refresh.c | |||
@@ -436,7 +436,7 @@ TALER_MINT_handler_refresh_melt (struct RequestHandler *rh, | |||
436 | denom_pubs, | 436 | denom_pubs, |
437 | coin_count, | 437 | coin_count, |
438 | coin_public_infos); | 438 | coin_public_infos); |
439 | 439 | // FIXME: free memory | |
440 | return res; | 440 | return res; |
441 | } | 441 | } |
442 | 442 | ||
@@ -696,8 +696,7 @@ helper_refresh_reveal_send_response (struct MHD_Connection *connection, | |||
696 | int res; | 696 | int res; |
697 | int newcoin_index; | 697 | int newcoin_index; |
698 | struct RefreshSession refresh_session; | 698 | struct RefreshSession refresh_session; |
699 | json_t *root; | 699 | struct TALER_RSA_Signature *sigs; |
700 | json_t *list; | ||
701 | 700 | ||
702 | res = TALER_MINT_DB_get_refresh_session (db_conn, | 701 | res = TALER_MINT_DB_get_refresh_session (db_conn, |
703 | refresh_session_pub, | 702 | refresh_session_pub, |
@@ -710,32 +709,27 @@ helper_refresh_reveal_send_response (struct MHD_Connection *connection, | |||
710 | } | 709 | } |
711 | 710 | ||
712 | GNUNET_assert (0 != refresh_session.reveal_ok); | 711 | GNUNET_assert (0 != refresh_session.reveal_ok); |
713 | 712 | sigs = GNUNET_malloc (refresh_session.num_newcoins * | |
714 | root = json_object (); | 713 | sizeof (struct TALER_RSA_Signature)); |
715 | list = json_array (); | ||
716 | json_object_set_new (root, "ev_sigs", list); | ||
717 | |||
718 | for (newcoin_index = 0; newcoin_index < refresh_session.num_newcoins; newcoin_index++) | 714 | for (newcoin_index = 0; newcoin_index < refresh_session.num_newcoins; newcoin_index++) |
719 | { | 715 | { |
720 | struct TALER_RSA_Signature ev_sig; | ||
721 | |||
722 | res = TALER_MINT_DB_get_refresh_collectable (db_conn, | 716 | res = TALER_MINT_DB_get_refresh_collectable (db_conn, |
723 | newcoin_index, | 717 | newcoin_index, |
724 | refresh_session_pub, | 718 | refresh_session_pub, |
725 | &ev_sig); | 719 | &sigs[newcoin_index]); |
726 | if (GNUNET_OK != res) | 720 | if (GNUNET_OK != res) |
727 | { | 721 | { |
728 | // FIXME: return 'internal error' | 722 | // FIXME: return 'internal error' |
729 | GNUNET_break (0); | 723 | GNUNET_break (0); |
724 | GNUNET_free (sigs); | ||
730 | return MHD_NO; | 725 | return MHD_NO; |
731 | } | 726 | } |
732 | json_array_append_new (list, | ||
733 | TALER_JSON_from_data (&ev_sig, | ||
734 | sizeof (struct TALER_RSA_Signature))); | ||
735 | } | 727 | } |
736 | return TALER_MINT_reply_json (connection, | 728 | res = TALER_MINT_reply_refresh_reveal_success (connection, |
737 | root, | 729 | refresh_session.num_newcoins, |
738 | MHD_HTTP_OK); | 730 | sigs); |
731 | GNUNET_free (sigs); | ||
732 | return res; | ||
739 | } | 733 | } |
740 | 734 | ||
741 | 735 | ||