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
0126d014
Commit
0126d014
authored
Jan 20, 2017
by
bas-vk
Committed by
Felix Lange
Jan 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
types: bugfix invalid V derivation on tx json unmarshal (#3594)
parent
946db8ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
transaction.go
core/types/transaction.go
+2
-1
transaction_signing.go
core/types/transaction_signing.go
+1
-1
No files found.
core/types/transaction.go
View file @
0126d014
...
...
@@ -198,7 +198,8 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error {
var
V
byte
if
isProtectedV
((
*
big
.
Int
)(
dec
.
V
))
{
V
=
byte
((
new
(
big
.
Int
)
.
Sub
((
*
big
.
Int
)(
dec
.
V
),
deriveChainId
((
*
big
.
Int
)(
dec
.
V
)))
.
Uint64
())
-
35
)
chainId
:=
deriveChainId
((
*
big
.
Int
)(
dec
.
V
))
.
Uint64
()
V
=
byte
(
dec
.
V
.
ToInt
()
.
Uint64
()
-
35
-
2
*
chainId
)
}
else
{
V
=
byte
(((
*
big
.
Int
)(
dec
.
V
))
.
Uint64
()
-
27
)
}
...
...
core/types/transaction_signing.go
View file @
0126d014
...
...
@@ -160,7 +160,7 @@ func (s EIP155Signer) PublicKey(tx *Transaction) ([]byte, error) {
// needs to be in the [R || S || V] format where V is 0 or 1.
func
(
s
EIP155Signer
)
WithSignature
(
tx
*
Transaction
,
sig
[]
byte
)
(
*
Transaction
,
error
)
{
if
len
(
sig
)
!=
65
{
panic
(
fmt
.
Sprintf
(
"wrong size for snature: got %d, want 65"
,
len
(
sig
)))
panic
(
fmt
.
Sprintf
(
"wrong size for s
ig
nature: got %d, want 65"
,
len
(
sig
)))
}
cpy
:=
&
Transaction
{
data
:
tx
.
data
}
...
...
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