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
36f7fe61
Commit
36f7fe61
authored
Aug 20, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core, tests: Double SUICIDE fix
parent
54088b0b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
785 additions
and
165 deletions
+785
-165
blocks.go
core/blocks.go
+1
-4
state_object.go
core/state/state_object.go
+3
-2
statedb.go
core/state/statedb.go
+9
-7
block_test_util.go
tests/block_test_util.go
+1
-1
bcValidBlockTest.json
tests/files/BlockchainTests/bcValidBlockTest.json
+771
-151
No files found.
core/blocks.go
View file @
36f7fe61
...
...
@@ -20,8 +20,5 @@ import "github.com/ethereum/go-ethereum/common"
// Set of manually tracked bad hashes (usually hard forks)
var
BadHashes
=
map
[
common
.
Hash
]
bool
{
common
.
HexToHash
(
"f269c503aed286caaa0d114d6a5320e70abbc2febe37953207e76a2873f2ba79"
)
:
true
,
common
.
HexToHash
(
"38f5bbbffd74804820ffa4bab0cd540e9de229725afb98c1a7e57936f4a714bc"
)
:
true
,
common
.
HexToHash
(
"7064455b364775a16afbdecd75370e912c6e2879f202eda85b9beae547fff3ac"
)
:
true
,
common
.
HexToHash
(
"5b7c80070a6eff35f3eb3181edb023465c776d40af2885571e1bc4689f3a44d8"
)
:
true
,
common
.
HexToHash
(
"0x05bef30ef572270f654746da22639a7a0c97dd97a7050b9e252391996aaeb689"
)
:
true
,
}
core/state/state_object.go
View file @
36f7fe61
...
...
@@ -82,8 +82,9 @@ type StateObject struct {
// Mark for deletion
// When an object is marked for deletion it will be delete from the trie
// during the "update" phase of the state transition
remove
bool
dirty
bool
remove
bool
deleted
bool
dirty
bool
}
func
(
self
*
StateObject
)
Reset
()
{
...
...
core/state/statedb.go
View file @
36f7fe61
...
...
@@ -203,18 +203,20 @@ func (self *StateDB) UpdateStateObject(stateObject *StateObject) {
// Delete the given state object and delete it from the state trie
func
(
self
*
StateDB
)
DeleteStateObject
(
stateObject
*
StateObject
)
{
stateObject
.
deleted
=
true
addr
:=
stateObject
.
Address
()
self
.
trie
.
Delete
(
addr
[
:
])
//delete(self.stateObjects, addr.Str())
}
// Retrieve a state object given my the address. Nil if not found
func
(
self
*
StateDB
)
GetStateObject
(
addr
common
.
Address
)
*
StateObject
{
//addr = common.Address(addr)
stateObject
:=
self
.
stateObjects
[
addr
.
Str
()]
func
(
self
*
StateDB
)
GetStateObject
(
addr
common
.
Address
)
(
stateObject
*
StateObject
)
{
stateObject
=
self
.
stateObjects
[
addr
.
Str
()]
if
stateObject
!=
nil
{
if
stateObject
.
deleted
{
stateObject
=
nil
}
return
stateObject
}
...
...
@@ -236,7 +238,7 @@ func (self *StateDB) SetStateObject(object *StateObject) {
// 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
{
if
stateObject
==
nil
||
stateObject
.
deleted
{
stateObject
=
self
.
CreateAccount
(
addr
)
}
...
...
tests/block_test_util.go
View file @
36f7fe61
...
...
@@ -150,7 +150,7 @@ func runBlockTests(bt map[string]*BlockTest, skipTests []string) error {
// test the block
if
err
:=
runBlockTest
(
test
);
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"%s: %v"
,
name
,
err
)
}
glog
.
Infoln
(
"Block test passed: "
,
name
)
...
...
tests/files/BlockchainTests/bcValidBlockTest.json
View file @
36f7fe61
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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