Check for both coinbase/append and submit/coinbase support before using GBT protocol.
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
diff --git a/cgminer.c b/cgminer.c
index 7971867..62f650c 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -4772,6 +4772,7 @@ retry_stratum:
val = json_rpc_call(curl, pool->rpc_url, pool->rpc_userpass,
gbt_req, true, false, &rolltime, pool, false);
if (val) {
+ bool append = false, submit = false;
json_t *res_val, *mutables;
int i, mutsize = 0;
@@ -4787,24 +4788,29 @@ retry_stratum:
if (json_is_string(arrval)) {
const char *mutable = json_string_value(arrval);
- /* Only use GBT if it supports coinbase append */
- if (!strncasecmp(mutable, "coinbase/append", 15)) {
- pool->has_gbt = true;
- pool->rpc_req = gbt_req;
- break;
- }
+ if (!strncasecmp(mutable, "coinbase/append", 15))
+ append = true;
+ else if (!strncasecmp(mutable, "submit/coinbase", 15))
+ submit = true;
}
}
json_decref(val);
+
+ /* Only use GBT if it supports coinbase append and
+ * submit coinbase */
+ if (append && submit) {
+ pool->has_gbt = true;
+ pool->rpc_req = gbt_req;
+ }
}
/* Reset this so we can probe fully just after this. It will be
* set to true that time.*/
pool->probed = false;
if (pool->has_gbt)
- applog(LOG_DEBUG, "GBT coinbase append support found, switching to GBT protocol");
+ applog(LOG_DEBUG, "GBT coinbase + append support found, switching to GBT protocol");
else
- applog(LOG_DEBUG, "No GBT coinbase append support found, using getwork protocol");
+ applog(LOG_DEBUG, "No GBT coinbase + append support found, using getwork protocol");
}
gettimeofday(&tv_getwork, NULL);