aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-08-31 23:09:50 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-10-04 07:13:56 +0800
commit7c7692933c21b77328a94eed714f66c276776197 (patch)
treef7a394c1823dd4da1ed2b37709c1c8f52c51b6ef /cmd/utils
parent361082ec4b942aea7c01fcb1be1782cb68b6fe3a (diff)
downloaddexon-7c7692933c21b77328a94eed714f66c276776197.tar
dexon-7c7692933c21b77328a94eed714f66c276776197.tar.gz
dexon-7c7692933c21b77328a94eed714f66c276776197.tar.bz2
dexon-7c7692933c21b77328a94eed714f66c276776197.tar.lz
dexon-7c7692933c21b77328a94eed714f66c276776197.tar.xz
dexon-7c7692933c21b77328a94eed714f66c276776197.tar.zst
dexon-7c7692933c21b77328a94eed714f66c276776197.zip
cmd/geth, cmd/utils, core, rpc: renamed to blockchain
* Renamed ChainManager to BlockChain * Checkpointing is no longer required and never really properly worked when the state was corrupted.
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/cmd.go12
-rw-r--r--cmd/utils/flags.go4
2 files changed, 8 insertions, 8 deletions
diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go
index 983762db8..5e4bfc937 100644
--- a/cmd/utils/cmd.go
+++ b/cmd/utils/cmd.go
@@ -169,7 +169,7 @@ func FormatTransactionData(data string) []byte {
return d
}
-func ImportChain(chain *core.ChainManager, fn string) error {
+func ImportChain(chain *core.BlockChain, fn string) error {
// Watch for Ctrl-C while the import is running.
// If a signal is received, the import will stop at the next batch.
interrupt := make(chan os.Signal, 1)
@@ -244,7 +244,7 @@ func ImportChain(chain *core.ChainManager, fn string) error {
return nil
}
-func hasAllBlocks(chain *core.ChainManager, bs []*types.Block) bool {
+func hasAllBlocks(chain *core.BlockChain, bs []*types.Block) bool {
for _, b := range bs {
if !chain.HasBlock(b.Hash()) {
return false
@@ -253,21 +253,21 @@ func hasAllBlocks(chain *core.ChainManager, bs []*types.Block) bool {
return true
}
-func ExportChain(chainmgr *core.ChainManager, fn string) error {
+func ExportChain(blockchain *core.BlockChain, fn string) error {
glog.Infoln("Exporting blockchain to", fn)
fh, err := os.OpenFile(fn, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.ModePerm)
if err != nil {
return err
}
defer fh.Close()
- if err := chainmgr.Export(fh); err != nil {
+ if err := blockchain.Export(fh); err != nil {
return err
}
glog.Infoln("Exported blockchain to", fn)
return nil
}
-func ExportAppendChain(chainmgr *core.ChainManager, fn string, first uint64, last uint64) error {
+func ExportAppendChain(blockchain *core.BlockChain, fn string, first uint64, last uint64) error {
glog.Infoln("Exporting blockchain to", fn)
// TODO verify mode perms
fh, err := os.OpenFile(fn, os.O_CREATE|os.O_APPEND|os.O_WRONLY, os.ModePerm)
@@ -275,7 +275,7 @@ func ExportAppendChain(chainmgr *core.ChainManager, fn string, first uint64, las
return err
}
defer fh.Close()
- if err := chainmgr.ExportN(fh, first, last); err != nil {
+ if err := blockchain.ExportN(fh, first, last); err != nil {
return err
}
glog.Infoln("Exported blockchain to", fn)
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index ad474f17d..dea43bc5c 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -508,7 +508,7 @@ func SetupEth(ctx *cli.Context) {
}
// MakeChain creates a chain manager from set command line flags.
-func MakeChain(ctx *cli.Context) (chain *core.ChainManager, chainDb ethdb.Database) {
+func MakeChain(ctx *cli.Context) (chain *core.BlockChain, chainDb ethdb.Database) {
datadir := MustDataDir(ctx)
cache := ctx.GlobalInt(CacheFlag.Name)
@@ -527,7 +527,7 @@ func MakeChain(ctx *cli.Context) (chain *core.ChainManager, chainDb ethdb.Databa
eventMux := new(event.TypeMux)
pow := ethash.New()
//genesis := core.GenesisBlock(uint64(ctx.GlobalInt(GenesisNonceFlag.Name)), blockDB)
- chain, err = core.NewChainManager(chainDb, pow, eventMux)
+ chain, err = core.NewBlockChain(chainDb, pow, eventMux)
if err != nil {
Fatalf("Could not start chainmanager: %v", err)
}