def blockChanged(): global DupeShareHACK DupeShareHACK = {} jsonrpc_getwork._CheckForDupesHACK = {} global MM, networkTarget, server bits = MM.currentBlock[2] if bits is None: networkTarget = None else: networkTarget = Bits2Target(bits) workLog.clear() updateBlocks()
def blockChanged(): global DupeShareHACK DupeShareHACK = {} jsonrpc_getwork._CheckForDupesHACK = {} global MM, networkTarget, server bits = MM.currentBlock[2] if bits is None: networkTarget = None else: networkTarget = Bits2Target(bits) workLog.clear() server.wakeLongpoll(wantClear=True) stratumsrv.updateJob(wantClear=True)
def blockChanged(triggeredByRskGetWork=False, cleanJobs=False): global MM, networkTarget, server bits = MM.currentBlock[2] if bits is None: networkTarget = None else: if hasattr(config, "DEV_MODE_ON") and config.DEV_MODE_ON: networkTarget = bdiff2target(config.BTC_ELOIPOOL_DIFF) else: networkTarget = Bits2Target(bits) if (MM.lastBlock != (None, None, None) and not triggeredByRskGetWork) or (triggeredByRskGetWork and cleanJobs): global DupeShareHACK DupeShareHACK = {} jsonrpc_getwork._CheckForDupesHACK = {} workLog.clear() server.wakeLongpoll(wantClear=True) # wantClear is False when the caller is RSK because only the RSK block hash needs to be changed on the coinbase # and there is no need to generate a new merkle tree stratumsrv.updateJob(wantClear=not triggeredByRskGetWork, triggeredByRskGetWork=triggeredByRskGetWork)