Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
whqwjb
go-ethereum
提交
1a8894b3
G
go-ethereum
项目概览
whqwjb
/
go-ethereum
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
go-ethereum
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1a8894b3
编写于
3月 28, 2018
作者:
J
Jia Chenhui
提交者:
Péter Szilágyi
3月 28, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
core/state: uniform parameter style (#16398)
- Uniform code style.
上级
80449719
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
10 deletion
+10
-10
core/state/statedb.go
core/state/statedb.go
+10
-10
未找到文件。
core/state/statedb.go
浏览文件 @
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
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录