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
b117da2d
Unverified
Commit
b117da2d
authored
Feb 28, 2017
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/state: drop most of a logs (useless at this volume)
parent
e02883c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
17 deletions
+2
-17
state_object.go
core/state/state_object.go
+0
-12
statedb.go
core/state/statedb.go
+2
-5
No files found.
core/state/state_object.go
View file @
b117da2d
...
...
@@ -24,7 +24,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/trie"
)
...
...
@@ -134,9 +133,6 @@ func (self *stateObject) markSuicided() {
self
.
onDirty
(
self
.
Address
())
self
.
onDirty
=
nil
}
log
.
Debug
(
""
,
"msg"
,
log
.
Lazy
{
Fn
:
func
()
string
{
return
fmt
.
Sprintf
(
"%x: #%d %v X
\n
"
,
self
.
Address
(),
self
.
Nonce
(),
self
.
Balance
())
}})
}
func
(
c
*
stateObject
)
touch
()
{
...
...
@@ -251,10 +247,6 @@ func (c *stateObject) AddBalance(amount *big.Int) {
return
}
c
.
SetBalance
(
new
(
big
.
Int
)
.
Add
(
c
.
Balance
(),
amount
))
log
.
Debug
(
""
,
"msg"
,
log
.
Lazy
{
Fn
:
func
()
string
{
return
fmt
.
Sprintf
(
"%x: #%d %v (+ %v)
\n
"
,
c
.
Address
(),
c
.
Nonce
(),
c
.
Balance
(),
amount
)
}})
}
// SubBalance removes amount from c's balance.
...
...
@@ -264,10 +256,6 @@ func (c *stateObject) SubBalance(amount *big.Int) {
return
}
c
.
SetBalance
(
new
(
big
.
Int
)
.
Sub
(
c
.
Balance
(),
amount
))
log
.
Debug
(
""
,
"msg"
,
log
.
Lazy
{
Fn
:
func
()
string
{
return
fmt
.
Sprintf
(
"%x: #%d %v (- %v)
\n
"
,
c
.
Address
(),
c
.
Nonce
(),
c
.
Balance
(),
amount
)
}})
}
func
(
self
*
stateObject
)
SetBalance
(
amount
*
big
.
Int
)
{
...
...
core/state/statedb.go
View file @
b117da2d
...
...
@@ -410,7 +410,7 @@ func (self *StateDB) getStateObject(addr common.Address) (stateObject *stateObje
}
var
data
Account
if
err
:=
rlp
.
DecodeBytes
(
enc
,
&
data
);
err
!=
nil
{
log
.
Error
(
fmt
.
Sprintf
(
"can't decode object at %x: %v"
,
addr
[
:
],
err
)
)
log
.
Error
(
"Failed to decode state object"
,
"addr"
,
addr
,
"err"
,
err
)
return
nil
}
// Insert into the live set.
...
...
@@ -445,9 +445,6 @@ func (self *StateDB) createObject(addr common.Address) (newobj, prev *stateObjec
newobj
=
newObject
(
self
,
addr
,
Account
{},
self
.
MarkStateObjectDirty
)
newobj
.
setNonce
(
0
)
// sets the object to dirty
if
prev
==
nil
{
log
.
Debug
(
""
,
"msg"
,
log
.
Lazy
{
Fn
:
func
()
string
{
return
fmt
.
Sprintf
(
"(+) %x
\n
"
,
addr
)
}})
self
.
journal
=
append
(
self
.
journal
,
createObjectChange
{
account
:
&
addr
})
}
else
{
self
.
journal
=
append
(
self
.
journal
,
resetObjectChange
{
prev
:
prev
})
...
...
@@ -616,7 +613,7 @@ func (s *StateDB) CommitBatch(deleteEmptyObjects bool) (root common.Hash, batch
batch
=
s
.
db
.
NewBatch
()
root
,
_
=
s
.
commit
(
batch
,
deleteEmptyObjects
)
log
.
Debug
(
fmt
.
Sprintf
(
"Trie cache stats: %d misses, %d unloads"
,
trie
.
CacheMisses
(),
trie
.
CacheUnloads
()
))
log
.
Debug
(
"Trie cache stats after commit"
,
"misses"
,
trie
.
CacheMisses
(),
"unloads"
,
trie
.
CacheUnloads
(
))
return
root
,
batch
}
...
...
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