Search in sources :

Example 1 with StateSource

use of org.ethereum.db.StateSource in project nuls by nuls-io.

the class CommonConfig method stateSource.

public StateSource stateSource() {
    if (this.stateSource == null) {
        // fastSyncCleanUp();
        StateSource stateSource = new StateSource(blockchainSource("state"), systemProperties().databasePruneDepth() >= 0);
        dbFlushManager().addCache(stateSource.getWriteCache());
        this.stateSource = stateSource;
    }
    return this.stateSource;
}
Also used : StateSource(org.ethereum.db.StateSource)

Example 2 with StateSource

use of org.ethereum.db.StateSource in project nuls by nuls-io.

the class ProgramExecutorImpl method stateSource.

private static Source<byte[], byte[]> stateSource(DBService dbService) {
    LevelDbDataSource.dbService = dbService;
    SystemProperties config = SystemProperties.getDefault();
    CommonConfig commonConfig = CommonConfig.getDefault();
    StateSource stateSource = commonConfig.stateSource();
    stateSource.setConfig(config);
    stateSource.setCommonConfig(commonConfig);
    return stateSource;
}
Also used : StateSource(org.ethereum.db.StateSource) SystemProperties(org.ethereum.config.SystemProperties) CommonConfig(org.ethereum.config.CommonConfig)

Aggregations

StateSource (org.ethereum.db.StateSource)2 CommonConfig (org.ethereum.config.CommonConfig)1 SystemProperties (org.ethereum.config.SystemProperties)1