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
529fb7a7
Commit
529fb7a7
authored
Jul 02, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core, xeth: core.AddressFromMessage removed => crypto.CreateAddress
parent
bb418a43
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
state_transition.go
core/state_transition.go
+0
-6
types.go
xeth/types.go
+2
-1
xeth.go
xeth/xeth.go
+7
-2
No files found.
core/state_transition.go
View file @
529fb7a7
...
@@ -7,7 +7,6 @@ import (
...
@@ -7,7 +7,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/params"
...
@@ -56,11 +55,6 @@ type Message interface {
...
@@ -56,11 +55,6 @@ type Message interface {
Data
()
[]
byte
Data
()
[]
byte
}
}
func
AddressFromMessage
(
msg
Message
)
common
.
Address
{
from
,
_
:=
msg
.
From
()
return
crypto
.
CreateAddress
(
from
,
msg
.
Nonce
())
}
func
MessageCreatesContract
(
msg
Message
)
bool
{
func
MessageCreatesContract
(
msg
Message
)
bool
{
return
msg
.
To
()
==
nil
return
msg
.
To
()
==
nil
}
}
...
...
xeth/types.go
View file @
529fb7a7
...
@@ -149,7 +149,8 @@ func NewTx(tx *types.Transaction) *Transaction {
...
@@ -149,7 +149,8 @@ func NewTx(tx *types.Transaction) *Transaction {
if
to
:=
tx
.
To
();
to
!=
nil
{
if
to
:=
tx
.
To
();
to
!=
nil
{
receiver
=
to
.
Hex
()
receiver
=
to
.
Hex
()
}
else
{
}
else
{
receiver
=
core
.
AddressFromMessage
(
tx
)
.
Hex
()
from
,
_
:=
tx
.
From
()
receiver
=
crypto
.
CreateAddress
(
from
,
tx
.
Nonce
())
.
Hex
()
}
}
createsContract
:=
core
.
MessageCreatesContract
(
tx
)
createsContract
:=
core
.
MessageCreatesContract
(
tx
)
...
...
xeth/xeth.go
View file @
529fb7a7
...
@@ -802,7 +802,12 @@ func (self *XEth) PushTx(encodedTx string) (string, error) {
...
@@ -802,7 +802,12 @@ func (self *XEth) PushTx(encodedTx string) (string, error) {
}
}
if
tx
.
To
()
==
nil
{
if
tx
.
To
()
==
nil
{
addr
:=
core
.
AddressFromMessage
(
tx
)
from
,
err
:=
tx
.
From
()
if
err
!=
nil
{
return
""
,
err
}
addr
:=
crypto
.
CreateAddress
(
from
,
tx
.
Nonce
())
glog
.
V
(
logger
.
Info
)
.
Infof
(
"Tx(%x) created: %x
\n
"
,
tx
.
Hash
(),
addr
)
glog
.
V
(
logger
.
Info
)
.
Infof
(
"Tx(%x) created: %x
\n
"
,
tx
.
Hash
(),
addr
)
return
addr
.
Hex
(),
nil
return
addr
.
Hex
(),
nil
}
else
{
}
else
{
...
@@ -969,7 +974,7 @@ func (self *XEth) Transact(fromStr, toStr, nonceStr, valueStr, gasStr, gasPriceS
...
@@ -969,7 +974,7 @@ func (self *XEth) Transact(fromStr, toStr, nonceStr, valueStr, gasStr, gasPriceS
}
}
if
contractCreation
{
if
contractCreation
{
addr
:=
c
ore
.
AddressFromMessage
(
tx
)
addr
:=
c
rypto
.
CreateAddress
(
from
,
nonce
)
glog
.
V
(
logger
.
Info
)
.
Infof
(
"Tx(%x) created: %x
\n
"
,
tx
.
Hash
(),
addr
)
glog
.
V
(
logger
.
Info
)
.
Infof
(
"Tx(%x) created: %x
\n
"
,
tx
.
Hash
(),
addr
)
return
addr
.
Hex
(),
nil
return
addr
.
Hex
(),
nil
}
else
{
}
else
{
...
...
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