Skip to content

Commit

Permalink
Make coinbaseaux flags optional
Browse files Browse the repository at this point in the history
Needed for solo mining on bitcoind, starting with v0.20.0
It's probably safe to delete the coinbase flags, but leave them in as optional for now.

See also: bitcoin/bitcoin@9aedabe
  • Loading branch information
golden-guy committed Mar 3, 2021
1 parent 3339a51 commit 168a1bd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cgminer.c
Expand Up @@ -2960,7 +2960,7 @@ static bool gbt_solo_decode(struct pool *pool, json_t *res_val)
flags = json_string_value(json_object_get(coinbase_aux, "flags"));
default_witness_commitment = json_string_value(json_object_get(res_val, "default_witness_commitment"));

if (!previousblockhash || !target || !version || !curtime || !bits || !coinbase_aux || !flags) {
if (!previousblockhash || !target || !version || !curtime || !bits) {
applog(LOG_ERR, "Pool %d JSON failed to decode GBT", pool->pool_no);
return false;
}
Expand Down Expand Up @@ -3039,10 +3039,12 @@ static bool gbt_solo_decode(struct pool *pool, json_t *res_val)
ofs += ser_number(pool->scriptsig_base + ofs, height); // max 5

/* Followed by flags */
len = strlen(flags) / 2;
pool->scriptsig_base[ofs++] = len;
hex2bin(pool->scriptsig_base + ofs, flags, len);
ofs += len;
if (flags) {
len = strlen(flags) / 2;
pool->scriptsig_base[ofs++] = len;
hex2bin(pool->scriptsig_base + ofs, flags, len);
ofs += len;
}

/* Followed by timestamp */
cgtime(&now);
Expand Down

0 comments on commit 168a1bd

Please sign in to comment.