From 3a66955ae693f0b5bb0d3578ec67e6bd96576690 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 23 Aug 2014 19:21:12 +1000 Subject: [PATCH] Add a preauth field for authorisations --- src/stratifier.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 56c01c87..64cd0b09 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1279,13 +1279,14 @@ static int send_recv_auth(stratum_instance_t *client) ts_realtime(&now); sprintf(cdfield, "%lu,%lu", now.tv_sec, now.tv_nsec); - val = json_pack("{ss,ss,ss,ss,sI,ss,ss,ss,ss,ss}", + val = json_pack("{ss,ss,ss,ss,sI,ss,sb,ss,ss,ss,ss}", "username", client->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__, @@ -1331,13 +1332,14 @@ static void queue_delayed_auth(stratum_instance_t *client) ts_realtime(&now); sprintf(cdfield, "%lu,%lu", now.tv_sec, now.tv_nsec); - val = json_pack("{ss,ss,ss,ss,sI,ss,ss,ss,ss,ss}", + val = json_pack("{ss,ss,ss,ss,sI,ss,sb,ss,ss,ss,ss}", "username", client->user_instance->username, "workername", client->workername, "poolinstance", ckp->name, "useragent", client->useragent, "clientid", client->id, "enonce1", client->enonce1, + "preauth", true, "createdate", cdfield, "createby", "code", "createcode", __func__,