Repair hashrate capture in ethhashmining coordinator (#39)

On the transition to the EthHash/Clique Mining Coordinator a change
was lost whereby the EthHashMiningCoordinator is to capture the
current Hashrate on cancellation of a mining operation.
tmohay 6 years ago committed by GitHub
parent bc51acabcf
commit b7acf0f737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      ethereum/core/src/main/java/net/consensys/pantheon/ethereum/blockcreation/EthHashMiningCoordinator.java

@ -58,4 +58,13 @@ public class EthHashMiningCoordinator extends AbstractMiningCoordinator<Void, Et
return currentRunningMiner.map(miner -> miner.submitWork(solution)).orElse(false); return currentRunningMiner.map(miner -> miner.submitWork(solution)).orElse(false);
} }
} }
@Override
protected void haltCurrentMiningOperation() {
currentRunningMiner.ifPresent(
miner -> {
miner.cancel();
miner.getHashesPerSecond().ifPresent(val -> cachedHashesPerSecond = Optional.of(val));
});
}
} }

Loading…
Cancel
Save