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
86f78933
Commit
86f78933
authored
Oct 16, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved state reset to defered function
parent
febec5ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
execution.go
ethvm/execution.go
+6
-5
No files found.
ethvm/execution.go
View file @
86f78933
...
...
@@ -28,6 +28,11 @@ func (self *Execution) Exec(codeAddr []byte, caller ClosureRef) (ret []byte, err
env
:=
self
.
vm
.
Env
()
snapshot
:=
env
.
State
()
.
Copy
()
defer
func
()
{
if
err
!=
nil
{
env
.
State
()
.
Set
(
snapshot
)
}
}()
msg
:=
env
.
State
()
.
Manifest
()
.
AddMessage
(
&
ethstate
.
Message
{
To
:
self
.
address
,
From
:
caller
.
Address
(),
...
...
@@ -49,7 +54,7 @@ func (self *Execution) Exec(codeAddr []byte, caller ClosureRef) (ret []byte, err
caller
.
Object
()
.
SubAmount
(
self
.
value
)
stateObject
.
AddAmount
(
self
.
value
)
// Precompiled contracts (address.go) 1, 2 & 3.
// Pre
-
compiled contracts (address.go) 1, 2 & 3.
naddr
:=
ethutil
.
BigD
(
codeAddr
)
.
Uint64
()
if
p
:=
Precompiled
[
naddr
];
p
!=
nil
{
if
self
.
gas
.
Cmp
(
p
.
Gas
)
>=
0
{
...
...
@@ -74,9 +79,5 @@ func (self *Execution) Exec(codeAddr []byte, caller ClosureRef) (ret []byte, err
}
}
if
err
!=
nil
{
env
.
State
()
.
Set
(
snapshot
)
}
return
}
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