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
7a410643
Commit
7a410643
authored
Jul 15, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added/changed logging
parent
34da3b4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
state_object.go
ethchain/state_object.go
+3
-2
vm.go
ethchain/vm.go
+9
-1
No files found.
ethchain/state_object.go
View file @
7a410643
...
...
@@ -143,6 +143,7 @@ func (self *StateObject) getStorage(k []byte) *ethutil.Value {
func
(
self
*
StateObject
)
setStorage
(
k
[]
byte
,
value
*
ethutil
.
Value
)
{
key
:=
ethutil
.
LeftPadBytes
(
k
,
32
)
//fmt.Printf("%x %v\n", key, value)
self
.
storage
[
string
(
key
)]
=
value
.
Copy
()
}
...
...
@@ -158,9 +159,9 @@ func (self *StateObject) Sync() {
valid
,
t2
:=
ethtrie
.
ParanoiaCheck
(
self
.
state
.
trie
)
if
!
valid
{
s
elf
.
state
.
trie
=
t2
s
tatelogger
.
Infof
(
"Warn: PARANOIA: Different state storage root during copy %x vs %x
\n
"
,
self
.
state
.
trie
.
Root
,
t2
.
Root
)
s
tatelogger
.
Infoln
(
"Warn: PARANOIA: Different state storage root during copy"
)
s
elf
.
state
.
trie
=
t2
}
}
...
...
ethchain/vm.go
View file @
7a410643
...
...
@@ -155,6 +155,15 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
// XXX Leave this Println intact. Don't change this to the log system.
// Used for creating diffs between implementations
if
vm
.
logTy
==
LogTyDiff
{
switch
op
{
case
STOP
,
RETURN
,
SUICIDE
:
closure
.
object
.
Sync
()
closure
.
object
.
state
.
EachStorage
(
func
(
key
string
,
value
*
ethutil
.
Value
)
{
value
.
Decode
()
fmt
.
Printf
(
"%x %x
\n
"
,
new
(
big
.
Int
)
.
SetBytes
([]
byte
(
key
))
.
Bytes
(),
value
.
Bytes
())
})
}
b
:=
pc
.
Bytes
()
if
len
(
b
)
==
0
{
b
=
[]
byte
{
0
}
...
...
@@ -184,7 +193,6 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
var
mult
*
big
.
Int
y
,
x
:=
stack
.
Peekn
()
val
:=
closure
.
GetStorage
(
x
)
//if val.IsEmpty() && len(y.Bytes()) > 0 {
if
val
.
BigInt
()
.
Cmp
(
ethutil
.
Big0
)
==
0
&&
len
(
y
.
Bytes
())
>
0
{
mult
=
ethutil
.
Big2
}
else
if
!
val
.
IsEmpty
()
&&
len
(
y
.
Bytes
())
==
0
{
...
...
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