This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
ethereumj-core/src/main/java/org/ethereum/sync Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -725,7 +725,7 @@ public void main() {
725725
726726 syncSecure ();
727727
728- listener . onSyncDone ( EthereumListener . SyncState . SECURE );
728+ fireSyncDone ( SECURE );
729729 case COMPLETE :
730730 if (origSyncStage == COMPLETE ) {
731731 logger .info ("FastSync: SECURE sync was completed prior to this run, proceeding with next stage..." );
@@ -735,11 +735,7 @@ public void main() {
735735
736736 syncBlocksReceipts ();
737737
738- // prevent early switch to COMPLETE state
739- syncManager .setSyncDoneType (EthereumListener .SyncState .COMPLETE );
740- if (syncManager .isSyncDone ()) {
741- listener .onSyncDone (EthereumListener .SyncState .COMPLETE );
742- }
738+ fireSyncDone (COMPLETE );
743739 }
744740 logger .info ("FastSync: Full sync done." );
745741 } catch (InterruptedException ex ) {
@@ -755,6 +751,14 @@ public void main() {
755751 }
756752 }
757753
754+ private void fireSyncDone (EthereumListener .SyncState state ) {
755+ // prevent early state notification when sync is not yet done
756+ syncManager .setSyncDoneType (state );
757+ if (syncManager .isSyncDone ()) {
758+ listener .onSyncDone (state );
759+ }
760+ }
761+
758762 public boolean isFastSyncInProgress () {
759763 return fastSyncInProgress ;
760764 }
You can’t perform that action at this time.
0 commit comments