mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 23:06:39 +01:00
Parse block only if height is right
This commit is contained in:
parent
9d2740eb32
commit
5c15e29f49
1 changed files with 3 additions and 1 deletions
|
@ -239,7 +239,9 @@ public abstract class BsqNode implements DaoSetupService {
|
||||||
// We take only first element after sorting (so it is the block with the next height) to avoid that
|
// We take only first element after sorting (so it is the block with the next height) to avoid that
|
||||||
// we would repeat calls in recursions in case we would iterate the list.
|
// we would repeat calls in recursions in case we would iterate the list.
|
||||||
pendingBlocks.sort(Comparator.comparing(RawBlock::getHeight));
|
pendingBlocks.sort(Comparator.comparing(RawBlock::getHeight));
|
||||||
doParseBlock(pendingBlocks.get(0));
|
RawBlock nextPending = pendingBlocks.get(0);
|
||||||
|
if (nextPending.getHeight() == daoStateService.getChainHeight() + 1)
|
||||||
|
doParseBlock(nextPending);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Optional.of(block);
|
return Optional.of(block);
|
||||||
|
|
Loading…
Add table
Reference in a new issue