From 16afc8a0c35ea2132334e3256e41de7d3e6be72f Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 29 Aug 2014 10:42:37 +1000 Subject: [PATCH] Set json manally in send_recv_auth to aid debugging of failures to set fields --- src/stratifier.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 64ebce70..31285670 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1327,18 +1327,18 @@ static int send_recv_auth(stratum_instance_t *client) ts_realtime(&now); sprintf(cdfield, "%lu,%lu", now.tv_sec, now.tv_nsec); - JSON_CPACK(val, "{ss,ss,ss,ss,sI,ss,sb,ss,ss,ss,ss}", - "username", user_instance->username, - "workername", client->workername, - "poolinstance", ckp->name, - "useragent", client->useragent, - "clientid", client->id, - "enonce1", client->enonce1, - "preauth", false, - "createdate", cdfield, - "createby", "code", - "createcode", __func__, - "createinet", client->address); + val = json_object(); + json_set_string(val, "username", user_instance->username); + json_set_string(val, "workername", client->workername); + json_set_string(val, "poolinstance", ckp->name); + json_set_string(val, "useragent", client->useragent); + json_set_int(val, "clientid", client->id); + json_set_string(val,"enonce1", client->enonce1); + json_set_bool(val, "preauth", false); + json_set_string(val, "createdate", cdfield); + json_set_string(val, "createby", "code"); + json_set_string(val, "createcode", __func__); + json_set_string(val, "createinet", client->address); if (user_instance->btcaddress) json_msg = ckdb_msg(ckp, val, ID_ADDRAUTH); else