<<  >> (p.110)
    Author Topic: GekkoScience NewPac Terminus R606 (BM1387) Official Support Thread  (Read 62585 times)
    This is a self-moderated topic. If you do not want to be moderated by the person who started this topic, create a new topic. (1 post by 1+ user deleted.)
    amand
    Newbie
    *
    Offline Offline

    Activity: 22
    Merit: 0


    View Profile
    December 12, 2021, 08:35:43 AM
     #2181

    Regarding
    cgminer issue with bitcoin core 0.20 and superior... (pool 0 json failed to decode gbt)

    Try something like this:

    Code:
    diff --git a/cgminer.c b/cgminer.c
    index ece7ce10..ab52e30a 100644
    --- a/cgminer.c
    +++ b/cgminer.c
    @@ -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;
            }
    @@ -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);

    Compiles clean, and should work just fine. Didn't test myself, since not running a node.


    Worked for me,  thanks 100knot2dae !
Page 109
Viewing Page: 110