mirror of
https://github.com/Cyrix126/gupaxx.git
synced 2024-12-22 22:59:27 +00:00
helper: fix false-positive p2pool sync
This commit is contained in:
parent
d27a1cad74
commit
63f5d69dff
1 changed files with 15 additions and 1 deletions
|
@ -1515,7 +1515,21 @@ impl PubP2poolApi {
|
||||||
let (payouts_new, xmr_new) = Self::calc_payouts_and_xmr(&output_parse);
|
let (payouts_new, xmr_new) = Self::calc_payouts_and_xmr(&output_parse);
|
||||||
// Check for "SYNCHRONIZED" only if we aren't already.
|
// Check for "SYNCHRONIZED" only if we aren't already.
|
||||||
if lock!(process).state == ProcessState::Syncing {
|
if lock!(process).state == ProcessState::Syncing {
|
||||||
if P2POOL_REGEX.synchronized.is_match(&output_parse) {
|
// How many times the word was captured.
|
||||||
|
let synchronized_captures = P2POOL_REGEX.synchronized.find_iter(&output_parse).count();
|
||||||
|
|
||||||
|
// If P2Pool receives shares before syncing, it will start mining on its own sidechain.
|
||||||
|
// In this instance, we technically are "synced" on block 1 and P2Pool will print "SYNCHRONIZED"
|
||||||
|
// although, that doesn't necessarily mean we're synced on main/mini-chain.
|
||||||
|
//
|
||||||
|
// So, if we find a `next block = 1`, that means we
|
||||||
|
// must look for at least 2 instances of "SYNCHRONIZED",
|
||||||
|
// one for the sidechain, one for main/mini.
|
||||||
|
if (P2POOL_REGEX.next_height_1.is_match(&output_parse) && synchronized_captures > 1)
|
||||||
|
// if there is no `next block = 1`, fallback to
|
||||||
|
// just finding 1 instance of "SYNCHRONIZED".
|
||||||
|
|| synchronized_captures > 0
|
||||||
|
{
|
||||||
lock!(process).state = ProcessState::Alive;
|
lock!(process).state = ProcessState::Alive;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue