Separated block db from state db. Partial fix for #416

This commit is contained in:
obscuren
2015-03-06 18:26:16 +01:00
parent ed84b58af5
commit cd856cb213
13 changed files with 56 additions and 40 deletions

View File

@ -175,11 +175,16 @@ func GetEthereum(clientID, version string, ctx *cli.Context) *eth.Ethereum {
return ethereum
}
func GetChain(ctx *cli.Context) (*core.ChainManager, ethutil.Database) {
func GetChain(ctx *cli.Context) (*core.ChainManager, ethutil.Database, ethutil.Database) {
dataDir := ctx.GlobalString(DataDirFlag.Name)
db, err := ethdb.NewLDBDatabase(path.Join(dataDir, "blockchain"))
blockDb, err := ethdb.NewLDBDatabase(path.Join(dataDir, "blockchain"))
if err != nil {
Fatalf("Could not open database: %v", err)
}
return core.NewChainManager(db, new(event.TypeMux)), db
stateDb, err := ethdb.NewLDBDatabase(path.Join(dataDir, "state"))
if err != nil {
Fatalf("Could not open database: %v", err)
}
return core.NewChainManager(blockDb, stateDb, new(event.TypeMux)), blockDb, stateDb
}