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
fc52f2c0
Commit
fc52f2c0
authored
Jan 23, 2017
by
Felix Lange
Committed by
GitHub
Jan 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/types: make Transaction zero value printable (#3595)
parent
96778a1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
transaction.go
core/types/transaction.go
+18
-14
No files found.
core/types/transaction.go
View file @
fc52f2c0
...
...
@@ -134,7 +134,7 @@ func (tx *Transaction) ChainId() *big.Int {
return
deriveChainId
(
tx
.
data
.
V
)
}
// Protected returns whether the transaction is pr
etected from replay protection
// Protected returns whether the transaction is pr
otected from replay protection.
func
(
tx
*
Transaction
)
Protected
()
bool
{
return
isProtectedV
(
tx
.
data
.
V
)
}
...
...
@@ -311,16 +311,20 @@ func (tx *Transaction) RawSignatureValues() (*big.Int, *big.Int, *big.Int) {
}
func
(
tx
*
Transaction
)
String
()
string
{
// make a best guess about the signer and use that to derive
// the sender.
signer
:=
deriveSigner
(
tx
.
data
.
V
)
var
from
,
to
string
if
f
,
err
:=
Sender
(
signer
,
tx
);
err
!=
nil
{
// derive but don't cache
from
=
"[invalid sender: invalid sig]"
if
tx
.
data
.
V
!=
nil
{
// make a best guess about the signer and use that to derive
// the sender.
signer
:=
deriveSigner
(
tx
.
data
.
V
)
if
f
,
err
:=
Sender
(
signer
,
tx
);
err
!=
nil
{
// derive but don't cache
from
=
"[invalid sender: invalid sig]"
}
else
{
from
=
fmt
.
Sprintf
(
"%x"
,
f
[
:
])
}
}
else
{
from
=
fmt
.
Sprintf
(
"%x"
,
f
[
:
])
from
=
"[invalid sender: nil V field]"
}
if
tx
.
data
.
Recipient
==
nil
{
to
=
"[contract creation]"
}
else
{
...
...
@@ -333,13 +337,13 @@ func (tx *Transaction) String() string {
From: %s
To: %s
Nonce: %v
GasPrice: %
v
GasLimit %
v
Value: %
v
GasPrice: %
#x
GasLimit %
#x
Value: %
#x
Data: 0x%x
V:
0x%
x
R:
0x%
x
S:
0x%
x
V:
%#
x
R:
%#
x
S:
%#
x
Hex: %x
`
,
tx
.
Hash
(),
...
...
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