Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
6628eeb6
Commit
6628eeb6
authored
Jul 31, 2015
by
zelig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jsre: leave out lines from history containing methods of the personal module
parent
e7f4232b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
js.go
cmd/geth/js.go
+17
-2
No files found.
cmd/geth/js.go
View file @
6628eeb6
...
...
@@ -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
]
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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment