Improve log

This commit is contained in:
chimp1984 2021-10-31 18:19:36 +01:00
parent 7c32587453
commit a3fbdf48d2
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3

View File

@ -80,10 +80,10 @@ public class BsqBlocksStorageService {
public LinkedList<Block> readBlocks(int chainHeight) {
long ts = System.currentTimeMillis();
LinkedList<Block> blocks = new LinkedList<>();
blocksPersistence.readBlocks(genesisBlockHeight, chainHeight).stream()
.map(Block::fromProto)
List<BaseBlock> list = blocksPersistence.readBlocks(genesisBlockHeight, chainHeight);
list.stream().map(Block::fromProto)
.forEach(blocks::add);
log.error("Reading {} blocks took {} ms", blocks.size(), System.currentTimeMillis() - ts);
log.error("Reading and deserializing {} blocks took {} ms", blocks.size(), System.currentTimeMillis() - ts);
if (!blocks.isEmpty()) {
chainHeightOfPersistedBlocks = getHeightOfLastFullBucket(blocks);
}