use of bisq.core.dao.blockchain.exceptions.BlockNotConnectingException in project bisq-core by bisq-network.
the class FullNodeParser method parseBlocks.
// /////////////////////////////////////////////////////////////////////////////////////////
// Package private
// /////////////////////////////////////////////////////////////////////////////////////////
@VisibleForTesting
void parseBlocks(int startBlockHeight, int chainHeadHeight, Consumer<BsqBlock> newBlockHandler) throws BsqBlockchainException, BlockNotConnectingException {
try {
for (int blockHeight = startBlockHeight; blockHeight <= chainHeadHeight; blockHeight++) {
Block btcdBlock = rpcService.requestBlock(blockHeight);
final BsqBlock bsqBlock = parseBlock(btcdBlock);
newBlockHandler.accept(bsqBlock);
}
} catch (BlockNotConnectingException e) {
throw e;
} catch (Throwable t) {
log.error(t.toString());
t.printStackTrace();
throw new BsqBlockchainException(t);
}
}
Aggregations