From 9b27adacb5432345d96ac130753692fd55277d71 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 29 Aug 2014 10:07:38 +1000 Subject: [PATCH] Send an auth request to ckdb for known btc addresses as addrauth --- src/stratifier.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 5239355c..64ebce70 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -268,6 +268,7 @@ static cklock_t share_lock; #define ID_POOLSTATS 5 #define ID_USERSTATS 6 #define ID_BLOCK 7 +#define ID_ADDRAUTH 8 static const char *ckdb_ids[] = { "authorise", @@ -277,7 +278,8 @@ static const char *ckdb_ids[] = { "shareerror", "poolstats", "userstats", - "block" + "block", + "addrauth", }; static void generate_coinbase(ckpool_t *ckp, workbase_t *wb) @@ -1337,7 +1339,10 @@ static int send_recv_auth(stratum_instance_t *client) "createby", "code", "createcode", __func__, "createinet", client->address); - json_msg = ckdb_msg(ckp, val, ID_AUTH); + if (user_instance->btcaddress) + json_msg = ckdb_msg(ckp, val, ID_ADDRAUTH); + else + json_msg = ckdb_msg(ckp, val, ID_AUTH); if (unlikely(!json_msg)) { LOGWARNING("Failed to dump json in send_recv_auth"); return ret;