Skip to content

Commit

Permalink
Merge branch 'develop' into fix/fast-sync-stall
Browse files Browse the repository at this point in the history
  • Loading branch information
zilm13 committed Mar 14, 2017
2 parents ce56df2 + c1fc129 commit 53b430a
Show file tree
Hide file tree
Showing 16 changed files with 137 additions and 637 deletions.
2 changes: 0 additions & 2 deletions ethereumj-core/build.gradle
Expand Up @@ -139,8 +139,6 @@ dependencies {
compile "com.typesafe:config:1.2.1"
compile "com.googlecode.concurrent-locks:concurrent-locks:1.0.0"

compile "org.mapdb:mapdb:2.0-beta12"

compile("com.googlecode.json-simple:json-simple:1.1.1") {
exclude group: 'junit', module: 'junit'
}
Expand Down
Expand Up @@ -5,8 +5,6 @@
import org.ethereum.datasource.*;
import org.ethereum.datasource.inmem.HashMapDB;
import org.ethereum.datasource.leveldb.LevelDbDataSource;
import org.ethereum.datasource.mapdb.MapDBFactory;
import org.ethereum.datasource.mapdb.MapDBFactoryImpl;
import org.ethereum.db.*;
import org.ethereum.listener.EthereumListener;
import org.ethereum.sync.FastSyncManager;
Expand Down Expand Up @@ -125,9 +123,7 @@ public DbSource<byte[]> keyValueDataSource(String name) {
String dataSource = systemProperties().getKeyValueDataSource();
try {
DbSource<byte[]> dbSource;
if ("mapdb".equals(dataSource)) {
dbSource = mapDBFactory().createDataSource();
} else if ("inmem".equals(dataSource)) {
if ("inmem".equals(dataSource)) {
dbSource = new HashMapDB<>();
} else {
dataSource = "leveldb";
Expand Down Expand Up @@ -249,7 +245,9 @@ public ParentBlockHeaderValidator parentHeaderValidator() {

@Bean
@Lazy
public MapDBFactory mapDBFactory() {
return new MapDBFactoryImpl();
public PeerSource peerSource() {
DbSource<byte[]> dbSource = keyValueDataSource("peers");
dbSources.add(dbSource);
return new PeerSource(dbSource);
}
}
Expand Up @@ -181,6 +181,11 @@ public QuotientFilter(int quotientBits, int remainderBits) {
entries = 0;
}

public QuotientFilter withMaxDuplicates(int maxDuplicates) {
MAX_DUPLICATES = maxDuplicates;
return this;
}

/* Return QF[idx] in the lower bits. */
long getElement(long idx) {
long elt = 0;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 53b430a

Please sign in to comment.