BlockStore store = checkNotNull(blockChain).getBlockStore(); StoredBlock chainHead = blockChain.getChainHead(); Sha256Hash chainHeadHash = chainHead.getHeader().getHash();
BlockStore store = checkNotNull(blockChain).getBlockStore(); StoredBlock chainHead = blockChain.getChainHead(); Sha256Hash chainHeadHash = chainHead.getHeader().getHash();
BlockStore store = checkNotNull(blockChain).getBlockStore(); StoredBlock chainHead = blockChain.getChainHead(); Sha256Hash chainHeadHash = chainHead.getHeader().getHash();
BlockStore store = checkNotNull(blockChain).getBlockStore(); StoredBlock chainHead = blockChain.getChainHead(); Sha256Hash chainHeadHash = chainHead.getHeader().getHash();
Sha256Hash _getBlockHash(long height) { try { StoredBlock head = blockChain.getChainHead(); BlockStore blockStore = blockChain.getBlockStore(); //long heightToFind = (height - 100) - ((height-100)%100); //If header is not stored, then return the tip //TODO: remove this or the whole function; if((head.getHeight() - 2050) > height) return null; StoredBlock cursor = head; while (cursor != null && cursor.getHeight() != (height-1)) { cursor = cursor.getPrev(blockStore); } return cursor != null ? cursor.getHeader().getHash() : null; } catch(BlockStoreException x) { return null; } }
public void setPeerGroupAndBlockChain(PeerGroup peerGroup, AbstractBlockChain chain) { this.peerGroup = peerGroup; this.blockChain = chain; hashStore = new HashStore(chain.getBlockStore()); chain.addListener(updateHeadListener); if(initializedDash) { sporkManager.setBlockChain(chain); masternodeManager.setBlockChain(chain); masternodeSync.setBlockChain(chain); instantSend.setBlockChain(chain); } params.setDIPActiveAtTip(chain.getBestChainHeight() >= params.getDIP0001BlockHeight()); }
StoredBlock storedBlock = context.masternodeManager.blockChain.getBlockStore().get(blockHash);