CliquePantheonController exposes mining coordinator (#117)

Previously the getMiningCoordinator() function on the
CliquePantheonController returned 'null' as a stub.

In order for the JSON RPC to operate correctly this function needs
to return the mining coordinator created during PantheonController
initialisation - which is the change introduced through this commit.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
tmohay 6 years ago committed by GitHub
parent 494f7b573c
commit 2e662fbeee
  1. 6
      pantheon/src/main/java/tech/pegasys/pantheon/controller/CliquePantheonController.java

@ -74,6 +74,7 @@ public class CliquePantheonController
private static final long EPOCH_LENGTH_DEFAULT = 30_000L;
private static final long SECONDS_BETWEEN_BLOCKS_DEFAULT = 15L;
private final CliqueMiningCoordinator miningCoordinator;
CliquePantheonController(
final GenesisConfig<CliqueContext> genesisConfig,
@ -82,6 +83,7 @@ public class CliquePantheonController
final Synchronizer synchronizer,
final KeyPair keyPair,
final TransactionPool transactionPool,
final CliqueMiningCoordinator miningCoordinator,
final Runnable closer) {
this.genesisConfig = genesisConfig;
@ -91,6 +93,7 @@ public class CliquePantheonController
this.keyPair = keyPair;
this.transactionPool = transactionPool;
this.closer = closer;
this.miningCoordinator = miningCoordinator;
}
public static PantheonController<CliqueContext, CliqueBlockMiner> init(
@ -174,6 +177,7 @@ public class CliquePantheonController
synchronizer,
nodeKeys,
transactionPool,
miningCoordinator,
() -> {
miningCoordinator.disable();
minerThreadPool.shutdownNow();
@ -218,7 +222,7 @@ public class CliquePantheonController
@Override
public AbstractMiningCoordinator<CliqueContext, CliqueBlockMiner> getMiningCoordinator() {
return null;
return miningCoordinator;
}
@Override

Loading…
Cancel
Save