summaryrefslogtreecommitdiff
path: root/src/mint/taler-mint-httpd_db.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-07-01 00:01:21 +0200
committerChristian Grothoff <christian@grothoff.org>2015-07-01 00:01:21 +0200
commitf948a10f712ebd6f52182dc4bf71deee1c45b35f (patch)
tree4ef609067c513547585f74bbd1d310cecae36e79 /src/mint/taler-mint-httpd_db.c
parent253d220ea54d45557f33dd3a7affef0e79593218 (diff)
downloadexchange-f948a10f712ebd6f52182dc4bf71deee1c45b35f.tar.gz
exchange-f948a10f712ebd6f52182dc4bf71deee1c45b35f.tar.bz2
exchange-f948a10f712ebd6f52182dc4bf71deee1c45b35f.zip
implementing #3851
Diffstat (limited to 'src/mint/taler-mint-httpd_db.c')
-rw-r--r--src/mint/taler-mint-httpd_db.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/mint/taler-mint-httpd_db.c b/src/mint/taler-mint-httpd_db.c
index 512ed9a48..e4e8c59ec 100644
--- a/src/mint/taler-mint-httpd_db.c
+++ b/src/mint/taler-mint-httpd_db.c
@@ -1393,8 +1393,33 @@ TMH_DB_execute_admin_add_incoming (struct MHD_Connection *connection,
struct GNUNET_TIME_Absolute execution_time,
json_t *wire)
{
- GNUNET_break (0); // FIXME: #3851!
- return MHD_NO;
+ struct TALER_MINTDB_Session *session;
+ int ret;
+
+ if (NULL == (session = TMH_plugin->get_session (TMH_plugin->cls,
+ TMH_test_mode)))
+ {
+ GNUNET_break (0);
+ return TMH_RESPONSE_reply_internal_db_error (connection);
+ }
+ ret = TMH_plugin->reserves_in_insert (TMH_plugin->cls,
+ session,
+ reserve_pub,
+ amount,
+ execution_time,
+ wire);
+ if (GNUNET_SYSERR == ret)
+ {
+ GNUNET_break (0);
+ return TMH_RESPONSE_reply_internal_db_error (connection);
+ }
+ return TMH_RESPONSE_reply_json_pack (connection,
+ MHD_HTTP_OK,
+ "{s:s}",
+ "status",
+ (GNUNET_OK == ret)
+ ? "NEW"
+ : "DUP");
}