aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-05-27 20:50:31 +0800
committerFelix Lange <fjl@twurst.com>2015-05-28 07:09:26 +0800
commit74706a0f029fe74ea15e366904d827da03091fef (patch)
tree716ff099fc17699e79cfb4cbd65d80221892a43a /cmd/geth
parent8e4512a5e7eecb53f41996776d55fe7acc92330c (diff)
downloadgo-tangerine-74706a0f029fe74ea15e366904d827da03091fef.tar
go-tangerine-74706a0f029fe74ea15e366904d827da03091fef.tar.gz
go-tangerine-74706a0f029fe74ea15e366904d827da03091fef.tar.bz2
go-tangerine-74706a0f029fe74ea15e366904d827da03091fef.tar.lz
go-tangerine-74706a0f029fe74ea15e366904d827da03091fef.tar.xz
go-tangerine-74706a0f029fe74ea15e366904d827da03091fef.tar.zst
go-tangerine-74706a0f029fe74ea15e366904d827da03091fef.zip
cmd/geth, cmd/utils: rename utils.Get* -> utils.Make*
The renaming should make it clearer that these functions create a new instance for every call. @obscuren suggested this renaming a while ago.
Diffstat (limited to 'cmd/geth')
-rw-r--r--cmd/geth/chaincmd.go10
-rw-r--r--cmd/geth/main.go8
2 files changed, 9 insertions, 9 deletions
diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go
index e17d1dc9b..1aed800f6 100644
--- a/cmd/geth/chaincmd.go
+++ b/cmd/geth/chaincmd.go
@@ -52,7 +52,7 @@ func importChain(ctx *cli.Context) {
if len(ctx.Args()) != 1 {
utils.Fatalf("This command requires an argument.")
}
- chain, blockDB, stateDB, extraDB := utils.GetChain(ctx)
+ chain, blockDB, stateDB, extraDB := utils.MakeChain(ctx)
start := time.Now()
if err := utils.ImportChain(chain, ctx.Args().First()); err != nil {
utils.Fatalf("Import error: %v\n", err)
@@ -65,7 +65,7 @@ func exportChain(ctx *cli.Context) {
if len(ctx.Args()) != 1 {
utils.Fatalf("This command requires an argument.")
}
- chain, _, _, _ := utils.GetChain(ctx)
+ chain, _, _, _ := utils.MakeChain(ctx)
start := time.Now()
if err := utils.ExportChain(chain, ctx.Args().First()); err != nil {
utils.Fatalf("Export error: %v\n", err)
@@ -95,7 +95,7 @@ func removeDB(ctx *cli.Context) {
func upgradeDB(ctx *cli.Context) {
glog.Infoln("Upgrading blockchain database")
- chain, blockDB, stateDB, extraDB := utils.GetChain(ctx)
+ chain, blockDB, stateDB, extraDB := utils.MakeChain(ctx)
v, _ := blockDB.Get([]byte("BlockchainVersion"))
bcVersion := int(common.NewValue(v).Uint())
if bcVersion == 0 {
@@ -113,7 +113,7 @@ func upgradeDB(ctx *cli.Context) {
os.RemoveAll(filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), "state"))
// Import the chain file.
- chain, blockDB, stateDB, extraDB = utils.GetChain(ctx)
+ chain, blockDB, stateDB, extraDB = utils.MakeChain(ctx)
blockDB.Put([]byte("BlockchainVersion"), common.NewValue(core.BlockChainVersion).Bytes())
err := utils.ImportChain(chain, exportFile)
flushAll(blockDB, stateDB, extraDB)
@@ -126,7 +126,7 @@ func upgradeDB(ctx *cli.Context) {
}
func dump(ctx *cli.Context) {
- chain, _, stateDB, _ := utils.GetChain(ctx)
+ chain, _, stateDB, _ := utils.MakeChain(ctx)
for _, arg := range ctx.Args() {
var block *types.Block
if hashish(arg) {
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index 9bf0fe610..eecd7546a 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -394,7 +394,7 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) {
}
func accountList(ctx *cli.Context) {
- am := utils.GetAccountManager(ctx)
+ am := utils.MakeAccountManager(ctx)
accts, err := am.Accounts()
if err != nil {
utils.Fatalf("Could not list accounts: %v", err)
@@ -436,7 +436,7 @@ func getPassPhrase(ctx *cli.Context, desc string, confirmation bool) (passphrase
}
func accountCreate(ctx *cli.Context) {
- am := utils.GetAccountManager(ctx)
+ am := utils.MakeAccountManager(ctx)
passphrase := getPassPhrase(ctx, "Your new account is locked with a password. Please give a password. Do not forget this password.", true)
acct, err := am.NewAccount(passphrase)
if err != nil {
@@ -455,7 +455,7 @@ func importWallet(ctx *cli.Context) {
utils.Fatalf("Could not read wallet file: %v", err)
}
- am := utils.GetAccountManager(ctx)
+ am := utils.MakeAccountManager(ctx)
passphrase := getPassPhrase(ctx, "", false)
acct, err := am.ImportPreSaleKey(keyJson, passphrase)
@@ -470,7 +470,7 @@ func accountImport(ctx *cli.Context) {
if len(keyfile) == 0 {
utils.Fatalf("keyfile must be given as argument")
}
- am := utils.GetAccountManager(ctx)
+ am := utils.MakeAccountManager(ctx)
passphrase := getPassPhrase(ctx, "Your new account is locked with a password. Please give a password. Do not forget this password.", true)
acct, err := am.Import(keyfile, passphrase)
if err != nil {