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
86e66995
Commit
86e66995
authored
Feb 15, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/0.2.2' into develop
parents
3fd57158
1ba7ffe9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
ethereum.go
ethereum.go
+13
-3
No files found.
ethereum.go
View file @
86e66995
...
...
@@ -32,12 +32,22 @@ func RegisterInterupts(s *eth.Ethereum) {
func
CreateKeyPair
(
force
bool
)
{
data
,
_
:=
ethutil
.
Config
.
Db
.
Get
([]
byte
(
"KeyRing"
))
if
len
(
data
)
==
0
||
force
{
log
.
Println
(
"Generating new address and keypair"
)
pub
,
prv
:=
secp256k1
.
GenerateKeyPair
()
addr
:=
ethutil
.
Sha3Bin
(
pub
[
1
:
])[
12
:
]
log
.
Printf
(
"Your new address is %x
\n
"
,
addr
)
fmt
.
Printf
(
`
Generating new address and keypair.
Please keep your keys somewhere save.
Currently Ethereum(G) does not support
exporting keys.
++++++++++++++++ KeyRing +++++++++++++++++++
addr: %x
prvk: %x
pubk: %x
++++++++++++++++++++++++++++++++++++++++++++
`
,
addr
,
prv
,
pub
)
keyRing
:=
ethutil
.
NewValue
([]
interface
{}{
prv
,
addr
,
pub
[
1
:
]})
ethutil
.
Config
.
Db
.
Put
([]
byte
(
"KeyRing"
),
keyRing
.
Encode
())
...
...
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