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
51d4566c
Commit
51d4566c
authored
May 11, 2015
by
Daniel A. Nagy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only allow doSign to sign hashes, enforced by using the type common.Hash
parent
49559e6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
xeth.go
xeth/xeth.go
+4
-4
No files found.
xeth/xeth.go
View file @
51d4566c
...
...
@@ -815,8 +815,8 @@ func (self *XEth) ConfirmTransaction(tx string) bool {
return
self
.
frontend
.
ConfirmTransaction
(
tx
)
}
func
(
self
*
XEth
)
doSign
(
from
common
.
Address
,
hash
[]
byte
,
didUnlock
bool
)
([]
byte
,
error
)
{
sig
,
err
:=
self
.
backend
.
AccountManager
()
.
Sign
(
accounts
.
Account
{
Address
:
from
.
Bytes
()},
hash
)
func
(
self
*
XEth
)
doSign
(
from
common
.
Address
,
hash
common
.
Hash
,
didUnlock
bool
)
([]
byte
,
error
)
{
sig
,
err
:=
self
.
backend
.
AccountManager
()
.
Sign
(
accounts
.
Account
{
Address
:
from
.
Bytes
()},
hash
.
Bytes
()
)
if
err
==
accounts
.
ErrLocked
{
if
didUnlock
{
return
nil
,
fmt
.
Errorf
(
"signer account still locked after successful unlock"
)
...
...
@@ -837,7 +837,7 @@ func (self *XEth) Sign(fromStr, hashStr string, didUnlock bool) (string, error)
from
=
common
.
HexToAddress
(
fromStr
)
hash
=
common
.
HexToHash
(
hashStr
)
)
sig
,
err
:=
self
.
doSign
(
from
,
hash
.
Bytes
()
,
didUnlock
)
sig
,
err
:=
self
.
doSign
(
from
,
hash
,
didUnlock
)
if
err
!=
nil
{
return
""
,
err
}
...
...
@@ -936,7 +936,7 @@ func (self *XEth) Transact(fromStr, toStr, nonceStr, valueStr, gasStr, gasPriceS
}
func
(
self
*
XEth
)
sign
(
tx
*
types
.
Transaction
,
from
common
.
Address
,
didUnlock
bool
)
error
{
hash
:=
tx
.
Hash
()
.
Bytes
()
hash
:=
tx
.
Hash
()
sig
,
err
:=
self
.
doSign
(
from
,
hash
,
didUnlock
)
if
err
!=
nil
{
return
err
...
...
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