RESOLVED: Seems this bug is still hanging around.....

Encounter a problem related to the pool or have a request for a feature? Post your issue here and we will help you out.
Forum rules
Welcome to the System Support forum! Encounter a problem related to the pool? Post your issue here and we will help you out.

Keep in mind that the forums are monitored by PROHASHING less closely than the official support channels, so if you have a pressing issue, please submit an official support ticket so that our Support Analyst can look into your issue in a timely manner.

We cannot answer financial questions related to your account on a public forum, so those questions should always be submitted through the orange Support button on prohashing.com/about.

For the full list of PROHASHING forums rules, please visit https://prohashing.com/help/prohashing- ... rms-forums.
User avatar
Steve Sokolowski
Posts: 4585
Joined: Wed Aug 27, 2014 3:27 pm
Location: State College, PA

Re: RESOLVED: Seems this bug is still hanging around.....

Post by Steve Sokolowski » Sun Jul 17, 2016 8:13 am

GenTarkin wrote:Well, after digging around some more and experimenting, came up w/ a more advanced fix.
No issues w/ balance - load balance that I can see =)
But basically, now the message is still displayed but I appended (normal for multicoin pools) to it and functionally the network diff & current block hash properly update back to the old block its mining. So, the "found new block messages" shouldnt show anymore because of improperly displayed net diff.

Here's the code, if you search for "if (was_active)" in miner.c
Just add the parts of my code that are different, to miner.c then recompile bfgminer

Code: Select all

                        if (was_active)
                        {
                                struct block_info * const t = calloc(sizeof(struct block_info), 1);
                                memcpy(t->prevblkhash, prevblkhash, sizeof(t->prevblkhash));
                                t->block_id = block_id;
                                t->block_seen_order = new_blocks++;
                                t->first_seen_time = time(NULL);
                                // Pool actively changed block
                                if (pool == current_pool())
                                        restart = true;
                                if (block_id == blkchain->currentblk->block_id)
                                {
                                        // Caught up, only announce if this pool is the one in use
                                        if (restart)
                                        {
                                                set_curblock(goal, t);
                                                set_blockdiff(goal, work);
                                                applog(LOG_NOTICE, "%s %d caught up to new block",
                                                       work->longpoll ? "Longpoll from pool" : "Pool",
                                                       pool->pool_no);
                                        }
                                }
                                else
                                {
                                        // Switched to a block we know, but not the latest... why?
                                        // This might detect pools trying to double-spend or 51%,
                                        // but let's not make any accusations until it's had time
                                        // in the real world.
                                        set_blockdiff(goal, work);
                                        set_curblock(goal, t);
                                        char hexstr[65];
                                        blkhashstr(hexstr, prevblkhash);
                                        applog(LOG_WARNING, "%s %d is issuing work for an old block: %s (Normal if multicoin pool)",
                                               work->longpoll ? "Longpoll from pool" : "Pool",
                                               pool->pool_no,
                                               hexstr);
                                }
                        }
                }
Can you submit this fix as a pull request to the official repo? That way, they should merge it and then the answer I can write on the documentation page is "upgrade to GenTarkin's version of bfgminer."
GenTarkin
Posts: 135
Joined: Wed Dec 02, 2015 10:52 am

Re: RESOLVED: Seems this bug is still hanging around.....

Post by GenTarkin » Sun Jul 17, 2016 2:45 pm

Done: https://github.com/luke-jr/bfgminer/pull/673
Lets see if it gets accepted .. lol first time doing this =P
GenTarkin
Posts: 135
Joined: Wed Dec 02, 2015 10:52 am

Re: RESOLVED: Seems this bug is still hanging around.....

Post by GenTarkin » Sun Jul 17, 2016 4:00 pm

Well according the luke-jr my changes "break normal use" ... not in my testing but w/e =(

He insists the pool itself implement set_goal
Locked