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
d91357d0
Commit
d91357d0
authored
Sep 07, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added GetCode method
parent
0fea62ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
state.go
ethstate/state.go
+9
-0
state_object.go
ethstate/state_object.go
+5
-1
No files found.
ethstate/state.go
View file @
d91357d0
...
@@ -49,6 +49,15 @@ func (self *State) GetNonce(addr []byte) uint64 {
...
@@ -49,6 +49,15 @@ func (self *State) GetNonce(addr []byte) uint64 {
return
0
return
0
}
}
func
(
self
*
State
)
GetCode
(
addr
[]
byte
)
[]
byte
{
stateObject
:=
self
.
GetStateObject
(
addr
)
if
stateObject
!=
nil
{
return
stateObject
.
Code
}
return
nil
}
//
//
// Setting, updating & deleting state object methods
// Setting, updating & deleting state object methods
//
//
...
...
ethstate/state_object.go
View file @
d91357d0
...
@@ -297,8 +297,12 @@ func (c *StateObject) RlpEncode() []byte {
...
@@ -297,8 +297,12 @@ func (c *StateObject) RlpEncode() []byte {
}
else
{
}
else
{
root
=
""
root
=
""
}
}
var
codeHash
[]
byte
if
len
(
c
.
Code
)
>
0
{
codeHash
=
ethcrypto
.
Sha3Bin
(
c
.
Code
)
}
return
ethutil
.
Encode
([]
interface
{}{
c
.
Nonce
,
c
.
Balance
,
root
,
ethcrypto
.
Sha3Bin
(
c
.
Code
)
})
return
ethutil
.
Encode
([]
interface
{}{
c
.
Nonce
,
c
.
Balance
,
root
,
codeHash
})
}
}
func
(
c
*
StateObject
)
RlpDecode
(
data
[]
byte
)
{
func
(
c
*
StateObject
)
RlpDecode
(
data
[]
byte
)
{
...
...
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