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
1954ef47
Commit
1954ef47
authored
Jul 01, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suicide is deferred to update
parent
fd1d0bbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
vm.go
ethchain/vm.go
+10
-6
bytes.go
ethutil/bytes.go
+2
-2
No files found.
ethchain/vm.go
View file @
1954ef47
...
...
@@ -150,7 +150,7 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
case
SSTORE
:
var
mult
*
big
.
Int
y
,
x
:=
stack
.
Peekn
()
val
:=
closure
.
Get
Mem
(
x
)
val
:=
closure
.
Get
Storage
(
x
)
if
val
.
IsEmpty
()
&&
len
(
y
.
Bytes
())
>
0
{
mult
=
ethutil
.
Big2
}
else
if
!
val
.
IsEmpty
()
&&
len
(
y
.
Bytes
())
==
0
{
...
...
@@ -567,7 +567,7 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
case
SLOAD
:
require
(
1
)
loc
:=
stack
.
Pop
()
val
:=
closure
.
Get
Mem
(
loc
)
val
:=
closure
.
Get
Storage
(
loc
)
stack
.
Push
(
val
.
BigInt
())
...
...
@@ -713,10 +713,14 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
receiver
:=
vm
.
state
.
GetAccount
(
stack
.
Pop
()
.
Bytes
())
receiver
.
AddAmount
(
closure
.
object
.
Amount
)
trie
:=
closure
.
object
.
state
.
trie
trie
.
NewIterator
()
.
Each
(
func
(
key
string
,
v
*
ethutil
.
Value
)
{
trie
.
Delete
(
key
)
})
closure
.
object
.
MarkForDeletion
()
/*
trie := closure.object.state.trie
trie.NewIterator().Each(func(key string, v *ethutil.Value) {
trie.Delete(key)
})
*/
fallthrough
case
STOP
:
// Stop the closure
...
...
ethutil/bytes.go
View file @
1954ef47
...
...
@@ -129,7 +129,7 @@ func FormatData(data string) []byte {
}
func
RightPadBytes
(
slice
[]
byte
,
l
int
)
[]
byte
{
if
l
<
=
len
(
slice
)
{
if
l
<
len
(
slice
)
{
return
slice
}
...
...
@@ -140,7 +140,7 @@ func RightPadBytes(slice []byte, l int) []byte {
}
func
LeftPadBytes
(
slice
[]
byte
,
l
int
)
[]
byte
{
if
l
<
=
len
(
slice
)
{
if
l
<
len
(
slice
)
{
return
slice
}
...
...
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