ckolivas/cgminer — pull request #281 by luke-jr (2012-07-30 18:11:20+00:00)
Title: Refactor stale_work to eliminate false positives

This also includes fixing a pretty major bug: if a secondary pool longpolls, cgminer sets the "current block" to the one it found; if --failover-only is enabled, this causes all the current work *and all new work* from the primary pool to be stale immediately. Thus, cgminer discards the new work and keeps getting more until the primary pool has caught up to the current block. With this refactor, cgminer will not consider work stale in --failover-only until the pool it is from has also caught up to the current block.