Browse Source

Send an auth request to ckdb for known btc addresses as addrauth

master
Con Kolivas 10 years ago
parent
commit
9b27adacb5
  1. 9
      src/stratifier.c

9
src/stratifier.c

@ -268,6 +268,7 @@ static cklock_t share_lock;
#define ID_POOLSTATS 5 #define ID_POOLSTATS 5
#define ID_USERSTATS 6 #define ID_USERSTATS 6
#define ID_BLOCK 7 #define ID_BLOCK 7
#define ID_ADDRAUTH 8
static const char *ckdb_ids[] = { static const char *ckdb_ids[] = {
"authorise", "authorise",
@ -277,7 +278,8 @@ static const char *ckdb_ids[] = {
"shareerror", "shareerror",
"poolstats", "poolstats",
"userstats", "userstats",
"block" "block",
"addrauth",
}; };
static void generate_coinbase(ckpool_t *ckp, workbase_t *wb) 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", "createby", "code",
"createcode", __func__, "createcode", __func__,
"createinet", client->address); "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)) { if (unlikely(!json_msg)) {
LOGWARNING("Failed to dump json in send_recv_auth"); LOGWARNING("Failed to dump json in send_recv_auth");
return ret; return ret;

Loading…
Cancel
Save