Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
whqwjb
go-ethereum
提交
36f7fe61
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 搜索 >>
提交
36f7fe61
编写于
8月 20, 2015
作者:
J
Jeffrey Wilcke
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
core, tests: Double SUICIDE fix
上级
54088b0b
变更
5
展开全部
显示空白变更内容
内联
并排
Showing
5 changed file
with
785 addition
and
165 deletion
+785
-165
core/blocks.go
core/blocks.go
+1
-4
core/state/state_object.go
core/state/state_object.go
+3
-2
core/state/statedb.go
core/state/statedb.go
+9
-7
tests/block_test_util.go
tests/block_test_util.go
+1
-1
tests/files/BlockchainTests/bcValidBlockTest.json
tests/files/BlockchainTests/bcValidBlockTest.json
+771
-151
未找到文件。
core/blocks.go
浏览文件 @
36f7fe61
...
@@ -20,8 +20,5 @@ import "github.com/ethereum/go-ethereum/common"
...
@@ -20,8 +20,5 @@ import "github.com/ethereum/go-ethereum/common"
// Set of manually tracked bad hashes (usually hard forks)
// Set of manually tracked bad hashes (usually hard forks)
var
BadHashes
=
map
[
common
.
Hash
]
bool
{
var
BadHashes
=
map
[
common
.
Hash
]
bool
{
common
.
HexToHash
(
"f269c503aed286caaa0d114d6a5320e70abbc2febe37953207e76a2873f2ba79"
)
:
true
,
common
.
HexToHash
(
"0x05bef30ef572270f654746da22639a7a0c97dd97a7050b9e252391996aaeb689"
)
:
true
,
common
.
HexToHash
(
"38f5bbbffd74804820ffa4bab0cd540e9de229725afb98c1a7e57936f4a714bc"
)
:
true
,
common
.
HexToHash
(
"7064455b364775a16afbdecd75370e912c6e2879f202eda85b9beae547fff3ac"
)
:
true
,
common
.
HexToHash
(
"5b7c80070a6eff35f3eb3181edb023465c776d40af2885571e1bc4689f3a44d8"
)
:
true
,
}
}
core/state/state_object.go
浏览文件 @
36f7fe61
...
@@ -83,6 +83,7 @@ type StateObject struct {
...
@@ -83,6 +83,7 @@ type StateObject struct {
// When an object is marked for deletion it will be delete from the trie
// When an object is marked for deletion it will be delete from the trie
// during the "update" phase of the state transition
// during the "update" phase of the state transition
remove
bool
remove
bool
deleted
bool
dirty
bool
dirty
bool
}
}
...
...
core/state/statedb.go
浏览文件 @
36f7fe61
...
@@ -203,18 +203,20 @@ func (self *StateDB) UpdateStateObject(stateObject *StateObject) {
...
@@ -203,18 +203,20 @@ func (self *StateDB) UpdateStateObject(stateObject *StateObject) {
// Delete the given state object and delete it from the state trie
// Delete the given state object and delete it from the state trie
func
(
self
*
StateDB
)
DeleteStateObject
(
stateObject
*
StateObject
)
{
func
(
self
*
StateDB
)
DeleteStateObject
(
stateObject
*
StateObject
)
{
stateObject
.
deleted
=
true
addr
:=
stateObject
.
Address
()
addr
:=
stateObject
.
Address
()
self
.
trie
.
Delete
(
addr
[
:
])
self
.
trie
.
Delete
(
addr
[
:
])
//delete(self.stateObjects, addr.Str())
}
}
// Retrieve a state object given my the address. Nil if not found
// Retrieve a state object given my the address. Nil if not found
func
(
self
*
StateDB
)
GetStateObject
(
addr
common
.
Address
)
*
StateObject
{
func
(
self
*
StateDB
)
GetStateObject
(
addr
common
.
Address
)
(
stateObject
*
StateObject
)
{
//addr = common.Address(addr)
stateObject
=
self
.
stateObjects
[
addr
.
Str
()]
stateObject
:=
self
.
stateObjects
[
addr
.
Str
()]
if
stateObject
!=
nil
{
if
stateObject
!=
nil
{
if
stateObject
.
deleted
{
stateObject
=
nil
}
return
stateObject
return
stateObject
}
}
...
@@ -236,7 +238,7 @@ func (self *StateDB) SetStateObject(object *StateObject) {
...
@@ -236,7 +238,7 @@ func (self *StateDB) SetStateObject(object *StateObject) {
// 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
{
func
(
self
*
StateDB
)
GetOrNewStateObject
(
addr
common
.
Address
)
*
StateObject
{
stateObject
:=
self
.
GetStateObject
(
addr
)
stateObject
:=
self
.
GetStateObject
(
addr
)
if
stateObject
==
nil
{
if
stateObject
==
nil
||
stateObject
.
deleted
{
stateObject
=
self
.
CreateAccount
(
addr
)
stateObject
=
self
.
CreateAccount
(
addr
)
}
}
...
...
tests/block_test_util.go
浏览文件 @
36f7fe61
...
@@ -150,7 +150,7 @@ func runBlockTests(bt map[string]*BlockTest, skipTests []string) error {
...
@@ -150,7 +150,7 @@ func runBlockTests(bt map[string]*BlockTest, skipTests []string) error {
// test the block
// test the block
if
err
:=
runBlockTest
(
test
);
err
!=
nil
{
if
err
:=
runBlockTest
(
test
);
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"%s: %v"
,
name
,
err
)
}
}
glog
.
Infoln
(
"Block test passed: "
,
name
)
glog
.
Infoln
(
"Block test passed: "
,
name
)
...
...
tests/files/BlockchainTests/bcValidBlockTest.json
浏览文件 @
36f7fe61
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录