Skip to content

Commit 4c2933a

Browse files
committed
Merge pull request #1993 from obscuren/remove-legalese
cmd/geth, cmd/utils: removed legalese
2 parents 7399b13 + 1c63d08 commit 4c2933a

File tree

3 files changed

+0
-77
lines changed

3 files changed

+0
-77
lines changed

cmd/geth/main.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,6 @@ func makeDefaultExtra() []byte {
405405
}
406406

407407
func run(ctx *cli.Context) {
408-
utils.CheckLegalese(utils.MustDataDir(ctx))
409-
410408
cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
411409
cfg.ExtraData = makeExtra(ctx)
412410

@@ -421,8 +419,6 @@ func run(ctx *cli.Context) {
421419
}
422420

423421
func attach(ctx *cli.Context) {
424-
utils.CheckLegalese(utils.MustDataDir(ctx))
425-
426422
var client comms.EthereumClient
427423
var err error
428424
if ctx.Args().Present() {
@@ -454,8 +450,6 @@ func attach(ctx *cli.Context) {
454450
}
455451

456452
func console(ctx *cli.Context) {
457-
utils.CheckLegalese(utils.MustDataDir(ctx))
458-
459453
cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
460454
cfg.ExtraData = makeExtra(ctx)
461455

@@ -488,8 +482,6 @@ func console(ctx *cli.Context) {
488482
}
489483

490484
func execJSFiles(ctx *cli.Context) {
491-
utils.CheckLegalese(utils.MustDataDir(ctx))
492-
493485
cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
494486
ethereum, err := eth.New(cfg)
495487
if err != nil {
@@ -515,8 +507,6 @@ func execJSFiles(ctx *cli.Context) {
515507
}
516508

517509
func unlockAccount(ctx *cli.Context, am *accounts.Manager, addr string, i int, inputpassphrases []string) (addrHex, auth string, passphrases []string) {
518-
utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name))
519-
520510
var err error
521511
passphrases = inputpassphrases
522512
addrHex, err = utils.ParamToAddress(addr, am)
@@ -541,16 +531,12 @@ func unlockAccount(ctx *cli.Context, am *accounts.Manager, addr string, i int, i
541531
}
542532

543533
func blockRecovery(ctx *cli.Context) {
544-
utils.CheckLegalese(utils.MustDataDir(ctx))
545-
546534
if len(ctx.Args()) < 1 {
547535
glog.Fatal("recover requires block number or hash")
548536
}
549537
arg := ctx.Args().First()
550538

551539
cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
552-
utils.CheckLegalese(cfg.DataDir)
553-
554540
blockDb, err := ethdb.NewLDBDatabase(filepath.Join(cfg.DataDir, "blockchain"), cfg.DatabaseCache)
555541
if err != nil {
556542
glog.Fatalln("could not open db:", err)
@@ -611,8 +597,6 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) {
611597
}
612598

613599
func accountList(ctx *cli.Context) {
614-
utils.CheckLegalese(utils.MustDataDir(ctx))
615-
616600
am := utils.MakeAccountManager(ctx)
617601
accts, err := am.Accounts()
618602
if err != nil {
@@ -664,8 +648,6 @@ func getPassPhrase(ctx *cli.Context, desc string, confirmation bool, i int, inpu
664648
}
665649

666650
func accountCreate(ctx *cli.Context) {
667-
utils.CheckLegalese(utils.MustDataDir(ctx))
668-
669651
am := utils.MakeAccountManager(ctx)
670652
passphrase, _ := getPassPhrase(ctx, "Your new account is locked with a password. Please give a password. Do not forget this password.", true, 0, nil)
671653
acct, err := am.NewAccount(passphrase)
@@ -676,8 +658,6 @@ func accountCreate(ctx *cli.Context) {
676658
}
677659

678660
func accountUpdate(ctx *cli.Context) {
679-
utils.CheckLegalese(utils.MustDataDir(ctx))
680-
681661
am := utils.MakeAccountManager(ctx)
682662
arg := ctx.Args().First()
683663
if len(arg) == 0 {
@@ -693,8 +673,6 @@ func accountUpdate(ctx *cli.Context) {
693673
}
694674

695675
func importWallet(ctx *cli.Context) {
696-
utils.CheckLegalese(utils.MustDataDir(ctx))
697-
698676
keyfile := ctx.Args().First()
699677
if len(keyfile) == 0 {
700678
utils.Fatalf("keyfile must be given as argument")
@@ -715,8 +693,6 @@ func importWallet(ctx *cli.Context) {
715693
}
716694

717695
func accountImport(ctx *cli.Context) {
718-
utils.CheckLegalese(utils.MustDataDir(ctx))
719-
720696
keyfile := ctx.Args().First()
721697
if len(keyfile) == 0 {
722698
utils.Fatalf("keyfile must be given as argument")
@@ -731,8 +707,6 @@ func accountImport(ctx *cli.Context) {
731707
}
732708

733709
func makedag(ctx *cli.Context) {
734-
utils.CheckLegalese(utils.MustDataDir(ctx))
735-
736710
args := ctx.Args()
737711
wrongArgs := func() {
738712
utils.Fatalf(`Usage: geth makedag <block number> <outputdir>`)

cmd/utils/cmd.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,6 @@ func PromptPassword(prompt string, warnTerm bool) (string, error) {
9595
return input, err
9696
}
9797

98-
func CheckLegalese(datadir string) {
99-
// check "first run"
100-
if !common.FileExist(datadir) {
101-
r, _ := PromptConfirm(legalese)
102-
if !r {
103-
Fatalf("Must accept to continue. Shutting down...\n")
104-
}
105-
}
106-
}
107-
10898
// Fatalf formats a message to standard error and exits the program.
10999
// The message is also printed to standard output if standard error
110100
// is redirected to a different file.

cmd/utils/legalese.go

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)