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
1a8894b3
Commit
1a8894b3
authored
Mar 28, 2018
by
Jia Chenhui
Committed by
Péter Szilágyi
Mar 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/state: uniform parameter style (#16398)
- Uniform code style.
parent
80449719
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
statedb.go
core/state/statedb.go
+10
-10
No files found.
core/state/statedb.go
View file @
1a8894b3
...
...
@@ -235,10 +235,10 @@ func (self *StateDB) GetCodeHash(addr common.Address) common.Hash {
return
common
.
BytesToHash
(
stateObject
.
CodeHash
())
}
func
(
self
*
StateDB
)
GetState
(
a
common
.
Address
,
b
common
.
Hash
)
common
.
Hash
{
stateObject
:=
self
.
getStateObject
(
a
)
func
(
self
*
StateDB
)
GetState
(
a
ddr
common
.
Address
,
bhash
common
.
Hash
)
common
.
Hash
{
stateObject
:=
self
.
getStateObject
(
a
ddr
)
if
stateObject
!=
nil
{
return
stateObject
.
GetState
(
self
.
db
,
b
)
return
stateObject
.
GetState
(
self
.
db
,
b
hash
)
}
return
common
.
Hash
{}
}
...
...
@@ -250,8 +250,8 @@ func (self *StateDB) Database() Database {
// StorageTrie returns the storage trie of an account.
// The return value is a copy and is nil for non-existent accounts.
func
(
self
*
StateDB
)
StorageTrie
(
a
common
.
Address
)
Trie
{
stateObject
:=
self
.
getStateObject
(
a
)
func
(
self
*
StateDB
)
StorageTrie
(
a
ddr
common
.
Address
)
Trie
{
stateObject
:=
self
.
getStateObject
(
a
ddr
)
if
stateObject
==
nil
{
return
nil
}
...
...
@@ -271,7 +271,7 @@ func (self *StateDB) HasSuicided(addr common.Address) bool {
* SETTERS
*/
// AddBalance adds amount to the account associated with addr
// AddBalance adds amount to the account associated with addr
.
func
(
self
*
StateDB
)
AddBalance
(
addr
common
.
Address
,
amount
*
big
.
Int
)
{
stateObject
:=
self
.
GetOrNewStateObject
(
addr
)
if
stateObject
!=
nil
{
...
...
@@ -279,7 +279,7 @@ func (self *StateDB) AddBalance(addr common.Address, amount *big.Int) {
}
}
// SubBalance subtracts amount from the account associated with addr
// SubBalance subtracts amount from the account associated with addr
.
func
(
self
*
StateDB
)
SubBalance
(
addr
common
.
Address
,
amount
*
big
.
Int
)
{
stateObject
:=
self
.
GetOrNewStateObject
(
addr
)
if
stateObject
!=
nil
{
...
...
@@ -308,7 +308,7 @@ func (self *StateDB) SetCode(addr common.Address, code []byte) {
}
}
func
(
self
*
StateDB
)
SetState
(
addr
common
.
Address
,
key
common
.
Hash
,
value
common
.
Hash
)
{
func
(
self
*
StateDB
)
SetState
(
addr
common
.
Address
,
key
,
value
common
.
Hash
)
{
stateObject
:=
self
.
GetOrNewStateObject
(
addr
)
if
stateObject
!=
nil
{
stateObject
.
SetState
(
self
.
db
,
key
,
value
)
...
...
@@ -337,7 +337,7 @@ func (self *StateDB) Suicide(addr common.Address) bool {
}
//
// Setting, updating & deleting state object methods
// Setting, updating & deleting state object methods
.
//
// updateStateObject writes the given object to the trie.
...
...
@@ -388,7 +388,7 @@ func (self *StateDB) setStateObject(object *stateObject) {
self
.
stateObjects
[
object
.
Address
()]
=
object
}
// Retrieve a state object or create a new state object if nil
// Retrieve a state object or create a new state object if nil
.
func
(
self
*
StateDB
)
GetOrNewStateObject
(
addr
common
.
Address
)
*
stateObject
{
stateObject
:=
self
.
getStateObject
(
addr
)
if
stateObject
==
nil
||
stateObject
.
deleted
{
...
...
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