@Test public void testGetBestBlockHeight() { assertNotNull(chainManager); Block block = createBlock(); ChainContainer masterChain = new ChainContainer(new Chain()); chainManager.setMasterChain(masterChain); masterChain.getChain().addBlock(block); assertEquals(0L, chainManager.getBestBlockHeight()); }
public long getBestBlockHeight() { if(masterChain == null || masterChain.getChain() == null || masterChain.getChain().getEndBlockHeader() == null) { return 0L; } return masterChain.getChain().getEndBlockHeader().getHeight(); }
ChainManager { public long getBestBlockHeight() { if(masterChain == null || masterChain.getChain() == null || masterChain.getChain().getEndBlockHeader() == null) { return 0L; } return masterChain.getChain().getEndBlockHeader().getHeight(); } }
ChainManager { public long getBestBlockHeight() { if(masterChain == null || masterChain.getChain() == null || masterChain.getChain().getEndBlockHeader() == null) { return 0L; } return masterChain.getChain().getEndBlockHeader().getHeight(); } ChainManager(); }
ChainManager { public long getBestBlockHeight() { if(masterChain == null || masterChain.getChain() == null || masterChain.getChain().getEndBlockHeader() == null) { return 0L; } return masterChain.getChain().getEndBlockHeader().getHeight(); } ChainManager(); void newOrphanChain(Block block); boolean checkIsBeforeOrphanChainAndAdd(Block block); boolean checkIsAfterOrphanChainAndAdd(Block block); long getBestBlockHeight(); void clear(); ChainContainer getMasterChain(); void setMasterChain(ChainContainer masterChain); List<ChainContainer> getChains(); Block getBestBlock(); List<ChainContainer> getOrphanChains(); }
ChainManager { public long getBestBlockHeight() { if(masterChain == null || masterChain.getChain() == null || masterChain.getChain().getEndBlockHeader() == null) { return 0L; } return masterChain.getChain().getEndBlockHeader().getHeight(); } ChainManager(); void newOrphanChain(Block block); boolean checkIsBeforeOrphanChainAndAdd(Block block); boolean checkIsAfterOrphanChainAndAdd(Block block); long getBestBlockHeight(); void clear(); ChainContainer getMasterChain(); void setMasterChain(ChainContainer masterChain); List<ChainContainer> getChains(); Block getBestBlock(); List<ChainContainer> getOrphanChains();  }