Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Welcome to ethereumj

[![Slack Status](http://harmony-slack-ether-camp.herokuapp.com/badge.svg)](http://ether.camp)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereum/ethereumj?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/ethereum/ethereumj.svg?branch=master)](https://travis-ci.org/ethereum/ethereumj)
[![Coverage Status](https://coveralls.io/repos/ethereum/ethereumj/badge.png?branch=master)](https://coveralls.io/r/ethereum/ethereumj?branch=master)
Expand All @@ -19,7 +18,7 @@ We keep EthereumJ as thin as possible. For [JSON-RPC](https://github.com/ethereu
<dependency>
<groupId>org.ethereum</groupId>
<artifactId>ethereumj-core</artifactId>
<version>1.6.3-RELEASE</version>
<version>1.8.0-RELEASE</version>
</dependency>
```

Expand All @@ -31,7 +30,7 @@ We keep EthereumJ as thin as possible. For [JSON-RPC](https://github.com/ethereu
jcenter()
maven { url "https://dl.bintray.com/ethereum/maven/" }
}
compile "org.ethereum:ethereumj-core:1.6.+"
compile "org.ethereum:ethereumj-core:1.8.+"
```

As a starting point for your own project take a look at https://github.com/ether-camp/ethereumj.starter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ public void main() {

syncSecure();

listener.onSyncDone(EthereumListener.SyncState.SECURE);
fireSyncDone(SECURE);
case COMPLETE:
if (origSyncStage == COMPLETE) {
logger.info("FastSync: SECURE sync was completed prior to this run, proceeding with next stage...");
Expand All @@ -735,7 +735,7 @@ public void main() {

syncBlocksReceipts();

listener.onSyncDone(EthereumListener.SyncState.COMPLETE);
fireSyncDone(COMPLETE);
}
logger.info("FastSync: Full sync done.");
} catch (InterruptedException ex) {
Expand All @@ -751,6 +751,14 @@ public void main() {
}
}

private void fireSyncDone(EthereumListener.SyncState state) {
// prevent early state notification when sync is not yet done
syncManager.setSyncDoneType(state);
if (syncManager.isSyncDone()) {
listener.onSyncDone(state);
}
}

public boolean isFastSyncInProgress() {
return fastSyncInProgress;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ void initRegularSync(EthereumListener.SyncState syncDoneType) {
}
}

void setSyncDoneType(EthereumListener.SyncState syncDoneType) {
this.syncDoneType = syncDoneType;
}

public SyncStatus getSyncStatus() {
if (config.isFastSyncEnabled()) {
SyncStatus syncStatus = fastSyncManager.getSyncState();
Expand Down