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.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
tmohay 6 years ago committed by GitHub
parent 24781c49ee
commit 22bc45a323
  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);
}
}
@Override
protected void haltCurrentMiningOperation() {
currentRunningMiner.ifPresent(
miner -> {
miner.cancel();
miner.getHashesPerSecond().ifPresent(val -> cachedHashesPerSecond = Optional.of(val));
});
}
}

Loading…
Cancel
Save