@@ -118,31 +118,30 @@ public void start() {
118
118
}
119
119
120
120
private SafeFuture <LoadDepositSnapshotResult > loadDepositSnapshot () {
121
- final LoadDepositSnapshotResult fileDepositSnapshotResult =
122
- depositSnapshotFileLoader .loadDepositSnapshot ();
123
- if (fileDepositSnapshotResult .getDepositTreeSnapshot ().isPresent ()
124
- && !takeBestDepositSnapshot ) {
125
- LOG .debug ("Deposit snapshot from file is provided, using it" );
126
- return SafeFuture .completedFuture (fileDepositSnapshotResult );
127
- }
128
-
129
- if (takeBestDepositSnapshot ) {
130
- STATUS_LOG .loadingDepositSnapshotFromDb ();
131
- return depositSnapshotStorageLoader
132
- .loadDepositSnapshot ()
133
- .thenApply (
134
- storageDepositSnapshotResult -> {
135
- if (storageDepositSnapshotResult .getDepositTreeSnapshot ().isPresent ()) {
136
- final DepositTreeSnapshot storageSnapshot =
137
- storageDepositSnapshotResult .getDepositTreeSnapshot ().get ();
138
- STATUS_LOG .onDepositSnapshot (
139
- storageSnapshot .getDepositCount (), storageSnapshot .getExecutionBlockHash ());
121
+ STATUS_LOG .loadingDepositSnapshotFromDb ();
122
+ return depositSnapshotStorageLoader
123
+ .loadDepositSnapshot ()
124
+ .thenApply (
125
+ storageDepositSnapshotResult -> {
126
+ if (storageDepositSnapshotResult .getDepositTreeSnapshot ().isPresent ()) {
127
+ final DepositTreeSnapshot storageSnapshot =
128
+ storageDepositSnapshotResult .getDepositTreeSnapshot ().get ();
129
+ STATUS_LOG .onDepositSnapshot (
130
+ storageSnapshot .getDepositCount (), storageSnapshot .getExecutionBlockHash ());
131
+ if (!takeBestDepositSnapshot ) {
132
+ return storageDepositSnapshotResult ;
140
133
}
134
+ }
135
+
136
+ final LoadDepositSnapshotResult fileDepositSnapshotResult =
137
+ depositSnapshotFileLoader .loadDepositSnapshot ();
138
+ if (takeBestDepositSnapshot ) {
141
139
return ObjectUtils .max (storageDepositSnapshotResult , fileDepositSnapshotResult );
142
- });
143
- } else {
144
- return depositSnapshotStorageLoader .loadDepositSnapshot ();
145
- }
140
+ }
141
+
142
+ LOG .debug ("Deposit snapshot from file is provided, using it" );
143
+ return fileDepositSnapshotResult ;
144
+ });
146
145
}
147
146
148
147
public void stop () {
0 commit comments