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
b909a5ec
Commit
b909a5ec
authored
Mar 03, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trie => SecureTrie
parent
1650b59c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
state_object.go
state/state_object.go
+1
-1
statedb.go
state/statedb.go
+2
-2
secure_trie.go
trie/secure_trie.go
+4
-0
No files found.
state/state_object.go
View file @
b909a5ec
...
@@ -290,7 +290,7 @@ func (c *StateObject) Init() Code {
...
@@ -290,7 +290,7 @@ func (c *StateObject) Init() Code {
return
c
.
initCode
return
c
.
initCode
}
}
func
(
self
*
StateObject
)
Trie
()
*
trie
.
Trie
{
func
(
self
*
StateObject
)
Trie
()
*
trie
.
Secure
Trie
{
return
self
.
State
.
trie
return
self
.
State
.
trie
}
}
...
...
state/statedb.go
View file @
b909a5ec
...
@@ -18,7 +18,7 @@ var statelogger = logger.NewLogger("STATE")
...
@@ -18,7 +18,7 @@ var statelogger = logger.NewLogger("STATE")
// * Accounts
// * Accounts
type
StateDB
struct
{
type
StateDB
struct
{
db
ethutil
.
Database
db
ethutil
.
Database
trie
*
trie
.
Trie
trie
*
trie
.
Secure
Trie
stateObjects
map
[
string
]
*
StateObject
stateObjects
map
[
string
]
*
StateObject
...
@@ -29,7 +29,7 @@ type StateDB struct {
...
@@ -29,7 +29,7 @@ type StateDB struct {
// Create a new state from a given trie
// Create a new state from a given trie
func
New
(
root
[]
byte
,
db
ethutil
.
Database
)
*
StateDB
{
func
New
(
root
[]
byte
,
db
ethutil
.
Database
)
*
StateDB
{
trie
:=
trie
.
New
(
ethutil
.
CopyBytes
(
root
),
db
)
trie
:=
trie
.
New
Secure
(
ethutil
.
CopyBytes
(
root
),
db
)
return
&
StateDB
{
db
:
db
,
trie
:
trie
,
stateObjects
:
make
(
map
[
string
]
*
StateObject
),
refund
:
make
(
map
[
string
]
*
big
.
Int
)}
return
&
StateDB
{
db
:
db
,
trie
:
trie
,
stateObjects
:
make
(
map
[
string
]
*
StateObject
),
refund
:
make
(
map
[
string
]
*
big
.
Int
)}
}
}
...
...
trie/secure_trie.go
View file @
b909a5ec
...
@@ -30,3 +30,7 @@ func (self *SecureTrie) Delete(key []byte) Node {
...
@@ -30,3 +30,7 @@ func (self *SecureTrie) Delete(key []byte) Node {
func
(
self
*
SecureTrie
)
DeleteString
(
key
string
)
Node
{
func
(
self
*
SecureTrie
)
DeleteString
(
key
string
)
Node
{
return
self
.
Delete
([]
byte
(
key
))
return
self
.
Delete
([]
byte
(
key
))
}
}
func
(
self
*
SecureTrie
)
Copy
()
*
SecureTrie
{
return
&
SecureTrie
{
self
.
Trie
.
Copy
()}
}
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