aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/geth')
-rw-r--r--cmd/geth/js.go19
-rw-r--r--cmd/geth/main.go4
2 files changed, 21 insertions, 2 deletions
diff --git a/cmd/geth/js.go b/cmd/geth/js.go
index b856e837b..bf56423ec 100644
--- a/cmd/geth/js.go
+++ b/cmd/geth/js.go
@@ -23,6 +23,7 @@ import (
"os"
"os/signal"
"path/filepath"
+ "regexp"
"strings"
"sort"
@@ -44,6 +45,10 @@ import (
"github.com/robertkrimen/otto"
)
+var passwordRegexp = regexp.MustCompile("personal.[nu]")
+
+const passwordRepl = ""
+
type prompter interface {
AppendHistory(string)
Prompt(p string) (string, error)
@@ -413,8 +418,10 @@ func (self *jsre) interactive() {
str += input + "\n"
self.setIndent()
if indentCount <= 0 {
- hist := str[:len(str)-1]
- self.AppendHistory(hist)
+ hist := hidepassword(str[:len(str)-1])
+ if len(hist) > 0 {
+ self.AppendHistory(hist)
+ }
self.parseInput(str)
str = ""
}
@@ -422,6 +429,14 @@ func (self *jsre) interactive() {
}
}
+func hidepassword(input string) string {
+ if passwordRegexp.MatchString(input) {
+ return passwordRepl
+ } else {
+ return input
+ }
+}
+
func (self *jsre) withHistory(op func(*os.File)) {
datadir := common.DefaultDataDir()
if self.ethereum != nil {
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index 9dc37f3a8..00dd8f753 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -281,6 +281,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils.BootnodesFlag,
utils.DataDirFlag,
utils.BlockchainVersionFlag,
+ utils.OlympicFlag,
utils.CacheFlag,
utils.JSpathFlag,
utils.ListenPortFlag,
@@ -347,6 +348,9 @@ func main() {
func run(ctx *cli.Context) {
utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name))
+ if ctx.GlobalBool(utils.OlympicFlag.Name) {
+ utils.InitOlympic()
+ }
cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
ethereum, err := eth.New(cfg)