mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Add isEmpty check
This commit is contained in:
parent
c600259267
commit
1108e98164
@ -129,9 +129,11 @@ public class DaoStateStorageService extends StoreService<DaoStateStore> {
|
||||
if (daoStateAsProto.getBlocksList().isEmpty()) {
|
||||
int chainHeight = daoStateAsProto.getChainHeight();
|
||||
list = bsqBlocksStorageService.readBlocks(chainHeight);
|
||||
int heightOfLastBlock = list.getLast().getHeight();
|
||||
checkArgument(heightOfLastBlock == chainHeight,
|
||||
"heightOfLastBlock must match chainHeight");
|
||||
if (!list.isEmpty()) {
|
||||
int heightOfLastBlock = list.getLast().getHeight();
|
||||
checkArgument(heightOfLastBlock == chainHeight,
|
||||
"heightOfLastBlock must match chainHeight");
|
||||
}
|
||||
} else {
|
||||
list = bsqBlocksStorageService.migrateBlocks(daoStateAsProto.getBlocksList());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user