Browse Source

Add a maximum diff option

master
Con Kolivas 10 years ago
parent
commit
255bab88fe
  1. 3
      README
  2. 1
      ckpool.conf
  3. 1
      ckproxy.conf
  4. 1
      src/ckpool.c
  5. 1
      src/ckpool.h
  6. 2
      src/stratifier.c

3
README

@ -252,4 +252,7 @@ and 3334 in proxy mode.
"startdiff" : Starting diff that new clients are given. Default 42
"maxdiff" : Optional maximum diff that vardiff will clamp to where zero is no
maximum.
"logdir" : Which directory to store pool and client logs. Default "logs"

1
ckpool.conf

@ -20,6 +20,7 @@
"serverurl" : "ckpool.org:3333",
"mindiff" : 1,
"startdiff" : 42,
"maxdiff" : 0,
"logdir" : "logs"
}
Comments from here on are ignored.

1
ckproxy.conf

@ -15,6 +15,7 @@
"serverurl" : "192.168.1.100:3334",
"mindiff" : 1,
"startdiff" : 42,
"maxdiff" : 0,
"logdir" : "logs"
}
Comments from here on are ignored.

1
src/ckpool.c

@ -983,6 +983,7 @@ static void parse_config(ckpool_t *ckp)
json_get_string(&ckp->serverurl, json_conf, "serverurl");
json_get_int64(&ckp->mindiff, json_conf, "mindiff");
json_get_int64(&ckp->startdiff, json_conf, "startdiff");
json_get_int64(&ckp->maxdiff, json_conf, "maxdiff");
json_get_string(&ckp->logdir, json_conf, "logdir");
arr_val = json_object_get(json_conf, "proxy");
if (arr_val && json_is_array(arr_val)) {

1
src/ckpool.h

@ -150,6 +150,7 @@ struct ckpool_instance {
/* Difficulty settings */
int64_t mindiff; // Default 1
int64_t startdiff; // Default 42
int64_t maxdiff; // No default
/* Coinbase data */
char *btcaddress; // Address to mine to

2
src/stratifier.c

@ -1838,6 +1838,8 @@ static void add_submit(ckpool_t *ckp, stratum_instance_t *client, int diff, bool
optimal = client->suggest_diff;
} else if (optimal < worker->mindiff)
optimal = worker->mindiff;
if (ckp->maxdiff && optimal > ckp->maxdiff)
optimal = ckp->maxdiff;
if (optimal > network_diff)
optimal = network_diff;
if (client->diff == optimal)

Loading…
Cancel
Save