use of io.nuls.consensus.entity.genesis.GenesisBlock in project nuls by nuls-io.
the class ConsensusManager method loadConfigration.
private void loadConfigration() {
Block bestBlock = null;
Block genesisBlock = GenesisBlock.getInstance();
NulsContext.getInstance().setGenesisBlock(genesisBlock);
try {
bestBlock = blockStorageService.getBlock(blockStorageService.getBestHeight());
} catch (Exception e) {
Log.error(e);
}
if (bestBlock == null) {
bestBlock = genesisBlock;
}
NulsContext.getInstance().setBestBlock(bestBlock);
partakePacking = NulsContext.MODULES_CONFIG.getCfgValue(PocConsensusConstant.CFG_CONSENSUS_SECTION, PocConsensusConstant.PROPERTY_PARTAKE_PACKING, false);
seedNodeList = new ArrayList<>();
Set<String> seedAddressSet = new HashSet<>();
String addresses = NulsContext.MODULES_CONFIG.getCfgValue(PocConsensusConstant.CFG_CONSENSUS_SECTION, PocConsensusConstant.PROPERTY_SEED_NODES, "");
if (StringUtils.isBlank(addresses)) {
return;
}
String[] array = addresses.split(PocConsensusConstant.SEED_NODES_DELIMITER);
if (null == array) {
return;
}
for (String address : array) {
seedAddressSet.add(address);
}
this.seedNodeList.addAll(seedAddressSet);
}
Aggregations