Deprecate the --donation feature. Needlessly complex, questionable usefulness, depends on author's server and a central pool of some kind, and was not heavily adopted.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335
diff --git a/README b/README
index cbdbdee..3fab82d 100644
--- a/README
+++ b/README
@@ -4,8 +4,8 @@ monitoring, (over)clocking and fanspeed support for bitcoin and derivative
coins. Do not use on multiple block chains at the same time!
This code is provided entirely free of charge by the programmer in his spare
-time so donations would be greatly appreciated. Please consider using the
---donation feature or donate directly to the address below.
+time so donations would be greatly appreciated. Please consider donating to the
+address below.
Con Kolivas <kernel@kolivas.org>
15qSxP1SQcUX3o4nhkfdbgyoWEFMomJ4rZ
@@ -126,7 +126,6 @@ Options for both config file and command line:
--auto-fan Automatically adjust all GPU fan speeds to maintain a target temperature
--auto-gpu Automatically adjust all GPU engine clock speeds to maintain a target temperature
--debug|-D Enable debug output
---donation <arg> Set donation percentage to cgminer author (0.0 - 99.9) (default: 0.0)
--expiry|-E <arg> Upper bound on how many seconds after getting work we consider a share from it stale (default: 120)
--failover-only Don't leak work to backup pools when primary pool is lagging
--load-balance Change multipool strategy from failover to even load balance
@@ -747,14 +746,6 @@ than whatever it is being packaged with. If you installed cgminer yourself,
then you do not have a virus on your computer. Complain to your antivirus
software company.
-Q: How does the donation feature work and how does it affect my shares?
-A: The donation feature is disabled by default and only does anything once
-enabled. It queries the author's website for login credentials and contributes
-up to a proportion of work to the author's account. While the overall
-accepted/rejected rates will include this work, none of these will appear in
-your own accounts. On exiting, the summary will tell you how many shares were
-contributed to the author.
-
Q: Can you modify the display to include more of one thing in the output and
less of another, or can you change the quiet mode or can you add yet another
output mode?
@@ -820,8 +811,8 @@ driver version and ATI stream version.
---
This code is provided entirely free of charge by the programmer in his spare
-time so donations would be greatly appreciated. Please consider using the
---donation feature or donate directly to the address below.
+time so donations would be greatly appreciated. Please consider donating to the
+address below.
Con Kolivas <kernel@kolivas.org>
15qSxP1SQcUX3o4nhkfdbgyoWEFMomJ4rZ
diff --git a/cgminer.c b/cgminer.c
index 1a70cd0..db944ac 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -176,9 +176,6 @@ unsigned int total_go, total_ro;
struct pool *pools[MAX_POOLS];
static struct pool *currentpool = NULL;
-static float opt_donation = 0.0;
-static struct pool donationpool;
-
int total_pools;
enum pool_strategy pool_strategy = POOL_FAILOVER;
int opt_rotate_period;
@@ -404,18 +401,6 @@ static char *set_int_1_to_10(const char *arg, int *i)
return set_int_range(arg, i, 1, 10);
}
-static char *set_float_0_to_99(const char *arg, float *f)
-{
- char *err = opt_set_floatval(arg, f);
- if (err)
- return err;
-
- if (*f < 0.0 || *f > 99.9)
- return "Value out of range";
-
- return NULL;
-}
-
#ifdef USE_BITFORCE
static char *add_serial(char *arg)
{
@@ -627,11 +612,6 @@ static struct opt_table opt_config_table[] = {
OPT_WITHOUT_ARG("--disable-gpu|-G",
opt_set_bool, &opt_nogpu,
"Disable GPU mining even if suitable devices exist"),
-#endif
- OPT_WITH_ARG("--donation",
- set_float_0_to_99, &opt_show_floatval, &opt_donation,
- "Set donation percentage to cgminer author (0.0 - 99.9)"),
-#ifdef HAVE_OPENCL
#if defined(WANT_CPUMINE) && (defined(HAVE_OPENCL) || defined(USE_BITFORCE))
OPT_WITHOUT_ARG("--enable-cpu|-C",
opt_set_bool, &opt_usecpu,
@@ -1333,11 +1313,6 @@ bool regeneratehash(const struct work *work)
return false;
}
-static bool donor(struct pool *pool)
-{
- return (pool == &donationpool);
-}
-
static bool submit_upstream_work(const struct work *work)
{
char *hexstr = NULL;
@@ -1394,14 +1369,11 @@ static bool submit_upstream_work(const struct work *work)
if (!pool_tset(pool, &pool->submit_fail)) {
total_ro++;
pool->remotefail_occasions++;
- if (!donor(pool))
- applog(LOG_WARNING, "Pool %d communication failure, caching submissions", pool->pool_no);
+ applog(LOG_WARNING, "Pool %d communication failure, caching submissions", pool->pool_no);
}
goto out;
- } else if (pool_tclear(pool, &pool->submit_fail)) {
- if (!donor(pool))
- applog(LOG_WARNING, "Pool %d communication resumed, submitting work", pool->pool_no);
- }
+ } else if (pool_tclear(pool, &pool->submit_fail))
+ applog(LOG_WARNING, "Pool %d communication resumed, submitting work", pool->pool_no);
res = json_object_get(val, "result");
@@ -1427,10 +1399,7 @@ static bool submit_upstream_work(const struct work *work)
if (opt_debug)
applog(LOG_DEBUG, "PROOF OF WORK RESULT: true (yay!!!)");
if (!QUIET) {
- if (donor(work->pool))
- applog(LOG_NOTICE, "Accepted %s %s %d thread %d donate",
- hashshow, cgpu->api->name, cgpu->device_id, thr_id);
- else if (total_pools > 1)
+ if (total_pools > 1)
applog(LOG_NOTICE, "Accepted %s %s %d thread %d pool %d",
hashshow, cgpu->api->name, cgpu->device_id, thr_id, work->pool->pool_no);
else
@@ -1449,10 +1418,7 @@ static bool submit_upstream_work(const struct work *work)
if (opt_debug)
applog(LOG_DEBUG, "PROOF OF WORK RESULT: false (booooo)");
if (!QUIET) {
- if (donor(work->pool))
- applog(LOG_NOTICE, "Rejected %s %s %d thread %d donate",
- hashshow, cgpu->api->name, cgpu->device_id, thr_id);
- else if (total_pools > 1)
+ if (total_pools > 1)
applog(LOG_NOTICE, "Rejected %s %s %d thread %d pool %d",
hashshow, cgpu->api->name, cgpu->device_id, thr_id, work->pool->pool_no);
else
@@ -1491,13 +1457,6 @@ static inline struct pool *select_pool(bool lagging)
static int rotating_pool = 0;
struct pool *pool, *cp;
- if (total_getworks && opt_donation > 0.0 && !donationpool.idle &&
- (float)donationpool.getwork_requested / (float)total_getworks < opt_donation / 100) {
- if (!lagging)
- return &donationpool;
- lagging = false;
- }
-
cp = current_pool();
if (pool_strategy != POOL_LOADBALANCE && !lagging)
@@ -1542,14 +1501,6 @@ retry:
while (!val && retries++ < 3) {
val = json_rpc_call(curl, pool->rpc_url, pool->rpc_userpass, rpc_req,
false, false, &work->rolltime, pool, false);
- if (donor(pool) && !val) {
- if (opt_debug)
- applog(LOG_DEBUG, "Donor pool lagging");
- pool = select_pool(true);
- if (opt_debug)
- applog(LOG_DEBUG, "DBG: sending %s get RPC call: %s", pool->rpc_url, rpc_req);
- retries = 0;
- }
}
if (unlikely(!val)) {
applog(LOG_DEBUG, "Failed json_rpc_call in get_upstream_work");
@@ -1764,10 +1715,6 @@ static bool stale_work(struct work *work, bool share)
} else if ((now.tv_sec - work->tv_staged.tv_sec) >= opt_scantime)
return true;
- /* Don't compare donor work in case it's on a different chain */
- if (donor(work->pool))
- return ret;
-
if (work->work_block != work_block)
ret = true;
return ret;
@@ -2045,11 +1992,6 @@ static void test_work_current(struct work *work, bool longpoll)
{
char *hexstr;
- /* Allow donation to not set current work, so it will work even if
- * mining on a different chain */
- if (donor(work->pool))
- return;
-
hexstr = bin2hex(work->data, 18);
if (unlikely(!hexstr)) {
applog(LOG_ERR, "stage_thread OOM");
@@ -2303,7 +2245,6 @@ void write_config(FILE *fcfg)
}
/* Special case options */
- fprintf(fcfg, ",\n\n\"donation\" : \"%.2f\"", opt_donation);
fprintf(fcfg, ",\n\"shares\" : \"%d\"", opt_shares);
if (pool_strategy == POOL_LOADBALANCE)
fputs(",\n\"load-balance\" : true", fcfg);
@@ -2906,12 +2847,8 @@ static bool pool_active(struct pool *pool, bool pinging)
} else {
applog(LOG_DEBUG, "FAILED to retrieve work from pool %u %s",
pool->pool_no, pool->rpc_url);
- if (!pinging) {
- if (!donor(pool))
- applog(LOG_WARNING, "Pool %u slow/down or URL or credentials invalid", pool->pool_no);
- else
- applog(LOG_WARNING, "Donor pool slow to respond");
- }
+ if (!pinging)
+ applog(LOG_WARNING, "Pool %u slow/down or URL or credentials invalid", pool->pool_no);
}
curl_easy_cleanup(curl);
@@ -2921,8 +2858,7 @@ static bool pool_active(struct pool *pool, bool pinging)
static void pool_died(struct pool *pool)
{
if (!pool_tset(pool, &pool->idle)) {
- if (!donor(pool))
- applog(LOG_WARNING, "Pool %d %s not responding!", pool->pool_no, pool->rpc_url);
+ applog(LOG_WARNING, "Pool %d %s not responding!", pool->pool_no, pool->rpc_url);
gettimeofday(&pool->tv_idle, NULL);
switch_pools(NULL);
}
@@ -2940,8 +2876,7 @@ static inline int cp_prio(void)
static void pool_resus(struct pool *pool)
{
- if (!donor(pool))
- applog(LOG_WARNING, "Pool %d %s recovered", pool->pool_no, pool->rpc_url);
+ applog(LOG_WARNING, "Pool %d %s recovered", pool->pool_no, pool->rpc_url);
if (pool->prio < cp_prio() && pool_strategy == POOL_FAILOVER)
switch_pools(NULL);
}
@@ -3022,7 +2957,7 @@ static inline bool should_roll(struct work *work)
static inline bool can_roll(struct work *work)
{
return (work->pool && !stale_work(work, false) && work->rolltime &&
- work->rolls < 11 && !work->clone && !donor(work->pool));
+ work->rolls < 11 && !work->clone);
}
static void roll_work(struct work *work)
@@ -3625,14 +3560,6 @@ static void *watchdog_thread(void *userdata)
}
}
- if (opt_donation > 0.0) {
- if (donationpool.idle && now.tv_sec - donationpool.tv_idle.tv_sec > 60) {
- gettimeofday(&donationpool.tv_idle, NULL);
- if (pool_active(&donationpool, true) && pool_tclear(&donationpool, &donationpool.idle))
- pool_resus(&donationpool);
- }
- }
-
if (pool_strategy == POOL_ROTATE && now.tv_sec - rotate_tv.tv_sec > 60 * opt_rotate_period) {
gettimeofday(&rotate_tv, NULL);
switch_pools(NULL);
@@ -3818,9 +3745,6 @@ static void print_summary(void)
}
}
- if (opt_donation > 0.0)
- applog(LOG_WARNING, "Donated share submissions: %d\n", donationpool.accepted + donationpool.rejected);
-
applog(LOG_WARNING, "Summary of per device statistics:\n");
for (i = 0; i < total_devices; ++i) {
if (devices[i]->enabled)
@@ -4378,19 +4302,6 @@ retry_pools:
goto retry_pools;
}
- if (opt_donation > 0.0) {
- if (!get_dondata(&donationpool.rpc_url, &donationpool.rpc_userpass))
- opt_donation = 0.0;
- else {
- if (unlikely(pthread_mutex_init(&donationpool.pool_lock, NULL)))
- quit (1, "Failed to pthread_mutex_init in add donpool");
- donationpool.enabled = true;
- donationpool.pool_no = MAX_POOLS;
- if (!pool_active(&donationpool, false))
- donationpool.idle = true;
- }
- }
-
if (want_longpoll)
start_longpoll();
@@ -4493,10 +4404,6 @@ retry_pools:
pthread_detach(thr->pth);
sleep(opt_log_interval);
- if (opt_donation > 0.0)
- applog(LOG_WARNING, "Donation is enabled at %.1f%% thank you :-)", opt_donation);
- else
- applog(LOG_WARNING, "--donation is disabled, please consider just 0.5%% :-(");
/* main loop - simply wait for workio thread to exit */
pthread_join(thr_info[work_thr_id].pth, NULL);
@@ -4527,4 +4434,3 @@ retry_pools:
return 0;
}
-
diff --git a/example.conf b/example.conf
index 2a1c6ee..7596ec3 100644
--- a/example.conf
+++ b/example.conf
@@ -27,7 +27,6 @@
"temp-overheat" : "85,85,85,85",
"temp-target" : "75,75,75,75",
-"algo" : "sse2_64",
"auto-fan" : true,
"auto-gpu" : true,
"expiry" : "120",
@@ -40,7 +39,6 @@
"temp-hysteresis" : "3",
"worksize" : "0",
-"donation" : "1.00",
"shares" : "0",
"kernel-path" : "/usr/local/bin"
-}
\ No newline at end of file
+}