@Override protected StoredBlock getStoredBlockInCurrentScope(Sha256Hash hash) throws BlockStoreException { return blockStore.get(hash); }
@Override protected StoredBlock getStoredBlockInCurrentScope(Sha256Hash hash) throws BlockStoreException { return blockStore.get(hash); }
@Override protected StoredBlock getStoredBlockInCurrentScope(Sha256Hash hash) throws BlockStoreException { return blockStore.get(hash); }
@Override protected StoredBlock getStoredBlockInCurrentScope(Sha256Hash hash) throws BlockStoreException { return blockStore.get(hash); }
/** * Given a block store, looks up the previous block in this chain. Convenience method for doing * <tt>store.get(this.getHeader().getPrevBlockHash())</tt>. * * @return the previous block in the chain or null if it was not found in the store. */ public StoredBlock getPrev(BlockStore store) throws BlockStoreException { return store.get(getHeader().getPrevBlockHash()); }
/** * Given a block store, looks up the previous block in this chain. Convenience method for doing * <tt>store.get(this.getHeader().getPrevBlockHash())</tt>. * * @return the previous block in the chain or null if it was not found in the store. */ public StoredBlock getPrev(BlockStore store) throws BlockStoreException { return store.get(getHeader().getPrevBlockHash()); }
/** * Given a block store, looks up the previous block in this chain. Convenience method for doing * <tt>store.get(this.getHeader().getPrevBlockHash())</tt>. * * @return the previous block in the chain or null if it was not found in the store. */ public StoredBlock getPrev(BlockStore store) throws BlockStoreException { return store.get(getHeader().getPrevBlockHash()); }
/** * Given a block store, looks up the previous block in this chain. Convenience method for doing * <tt>store.get(this.getHeader().getPrevBlockHash())</tt>. * * @return the previous block in the chain or null if it was not found in the store. */ public StoredBlock getPrev(BlockStore store) throws BlockStoreException { return store.get(getHeader().getPrevBlockHash()); }
@Override public Date getBlockTime() throws MissingTransactionInformationException { if (this.blockTime == null) { try { this.blockTime = bitcoinjTxOutput.getParentTransaction() .getAppearsInHashes().keySet().stream() .map((blockHash) -> { try { return bitcoinjBlockStore.get(blockHash); } catch (BlockStoreException e) { // This can happen if the transaction was seen in a side-chain return null; } }) .filter(Objects::nonNull) .map(StoredBlock::getHeader) .map(Block::getTime) .min(Date::compareTo).get(); } catch (Exception e) { throw new MissingTransactionInformationException("Couldn't fetch block time.", e); } } return this.blockTime; }
@Override public Long getBlockHeight() throws MissingTransactionInformationException { if (this.blockHeight == null) { try { this.blockHeight = bitcoinjTxOutput.getParentTransaction() .getAppearsInHashes().keySet().stream() .map((blockHash) -> { try { return bitcoinjBlockStore.get(blockHash); } catch (BlockStoreException e) { // This can happen if the transaction was seen in a side-chain return null; } }) .filter(Objects::nonNull) .map(StoredBlock::getHeight) .min(Integer::compareTo).get().longValue(); } catch (Exception e) { throw new MissingTransactionInformationException("Couldn't fetch block height.", e); } } return this.blockHeight; }
final int interval = this.getInterval(); for (int i = 0; i < interval; i++) { cursor = blockStore.get(hash); if (cursor == null) {
final int interval = this.getInterval(); for (int i = 0; i < interval; i++) { cursor = blockStore.get(hash); if (cursor == null) {
if (shouldVerifyTransactions() && blockStore.get(block.getHash()) != null) { return true;
if (shouldVerifyTransactions() && blockStore.get(block.getHash()) != null) { return true;
if (shouldVerifyTransactions() && blockStore.get(block.getHash()) != null) { return true;
if (shouldVerifyTransactions() && blockStore.get(block.getHash()) != null) { return true;
"Difficulty transition point but we did not find a way back to the genesis block."); cursor = blockStore.get(cursor.getHeader().getPrevBlockHash());