Refactor: Refactor statement and return early

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
HenrikJannsen 2024-06-29 13:32:39 +07:00
parent 143d1e9cc6
commit 63f364424c
No known key found for this signature in database
GPG Key ID: 02AA2BAE387C8307

View File

@ -218,10 +218,8 @@ public class DaoStateSnapshotService implements DaoSetupService, DaoStateListene
return;
}
// Either we don't have a snapshot candidate yet, or if we have one the height at that snapshot candidate must be
// different to our current height.
boolean noSnapshotCandidateOrDifferentHeight = daoStateCandidate == null || snapshotHeight != chainHeight;
if (!noSnapshotCandidateOrDifferentHeight) {
if (daoStateCandidate != null && snapshotHeight == chainHeight) {
log.error("snapshotHeight is same as chainHeight. This should never happen. chainHeight={}", chainHeight);
return;
}