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
18897271
Commit
18897271
authored
Apr 04, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved logging to logger.Core
parent
218bfeb6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
12 deletions
+12
-12
block_processor.go
core/block_processor.go
+2
-2
state_object.go
core/state/state_object.go
+4
-4
statedb.go
core/state/statedb.go
+1
-1
state_transition.go
core/state_transition.go
+3
-4
verbosity.go
logger/verbosity.go
+1
-0
whisper.go
whisper/whisper.go
+1
-1
No files found.
core/block_processor.go
View file @
18897271
...
...
@@ -257,8 +257,8 @@ func (sm *BlockProcessor) ValidateHeader(block, parent *types.Header) error {
return
fmt
.
Errorf
(
"GasLimit check failed for block %v (%v > %v)"
,
block
.
GasLimit
,
a
,
b
)
}
// Allow future blocks up to
4
seconds
if
int64
(
block
.
Time
)
+
4
>
time
.
Now
()
.
Unix
()
{
// Allow future blocks up to
10
seconds
if
int64
(
block
.
Time
)
+
10
>
time
.
Now
()
.
Unix
()
{
return
BlockFutureErr
}
...
...
core/state/state_object.go
View file @
18897271
...
...
@@ -124,7 +124,7 @@ func (self *StateObject) MarkForDeletion() {
self
.
remove
=
true
self
.
dirty
=
true
if
glog
.
V
(
logger
.
Debug
)
{
if
glog
.
V
(
logger
.
Core
)
{
glog
.
Infof
(
"%x: #%d %v X
\n
"
,
self
.
Address
(),
self
.
nonce
,
self
.
balance
)
}
}
...
...
@@ -190,7 +190,7 @@ func (c *StateObject) GetInstr(pc *big.Int) *common.Value {
func
(
c
*
StateObject
)
AddBalance
(
amount
*
big
.
Int
)
{
c
.
SetBalance
(
new
(
big
.
Int
)
.
Add
(
c
.
balance
,
amount
))
if
glog
.
V
(
logger
.
Debug
)
{
if
glog
.
V
(
logger
.
Core
)
{
glog
.
Infof
(
"%x: #%d %v (+ %v)
\n
"
,
c
.
Address
(),
c
.
nonce
,
c
.
balance
,
amount
)
}
}
...
...
@@ -198,7 +198,7 @@ func (c *StateObject) AddBalance(amount *big.Int) {
func
(
c
*
StateObject
)
SubBalance
(
amount
*
big
.
Int
)
{
c
.
SetBalance
(
new
(
big
.
Int
)
.
Sub
(
c
.
balance
,
amount
))
if
glog
.
V
(
logger
.
Debug
)
{
if
glog
.
V
(
logger
.
Core
)
{
glog
.
Infof
(
"%x: #%d %v (- %v)
\n
"
,
c
.
Address
(),
c
.
nonce
,
c
.
balance
,
amount
)
}
}
...
...
@@ -234,7 +234,7 @@ func (c *StateObject) ConvertGas(gas, price *big.Int) error {
func
(
self
*
StateObject
)
SetGasPool
(
gasLimit
*
big
.
Int
)
{
self
.
gasPool
=
new
(
big
.
Int
)
.
Set
(
gasLimit
)
if
glog
.
V
(
logger
.
Debug
)
{
if
glog
.
V
(
logger
.
Core
)
{
glog
.
Infof
(
"%x: gas (+ %v)"
,
self
.
Address
(),
self
.
gasPool
)
}
}
...
...
core/state/statedb.go
View file @
18897271
...
...
@@ -209,7 +209,7 @@ func (self *StateDB) GetOrNewStateObject(addr common.Address) *StateObject {
// NewStateObject create a state object whether it exist in the trie or not
func
(
self
*
StateDB
)
newStateObject
(
addr
common
.
Address
)
*
StateObject
{
if
glog
.
V
(
logger
.
Debug
)
{
if
glog
.
V
(
logger
.
Core
)
{
glog
.
Infof
(
"(+) %x
\n
"
,
addr
)
}
...
...
core/state_transition.go
View file @
18897271
...
...
@@ -8,6 +8,8 @@ import (
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/params"
)
...
...
@@ -166,9 +168,6 @@ func (self *StateTransition) preCheck() (err error) {
}
func
(
self
*
StateTransition
)
transitionState
()
(
ret
[]
byte
,
usedGas
*
big
.
Int
,
err
error
)
{
// statelogger.Debugf("(~) %x\n", self.msg.Hash())
// XXX Transactions after this point are considered valid.
if
err
=
self
.
preCheck
();
err
!=
nil
{
return
}
...
...
@@ -207,7 +206,7 @@ func (self *StateTransition) transitionState() (ret []byte, usedGas *big.Int, er
if
err
:=
self
.
UseGas
(
dataGas
);
err
==
nil
{
ref
.
SetCode
(
ret
)
}
else
{
statelogger
.
Infoln
(
"Insufficient gas for creating code. Require"
,
dataGas
,
"and have"
,
self
.
gas
)
glog
.
V
(
logger
.
Core
)
.
Infoln
(
"Insufficient gas for creating code. Require"
,
dataGas
,
"and have"
,
self
.
gas
)
}
}
}
else
{
...
...
logger/verbosity.go
View file @
18897271
...
...
@@ -3,6 +3,7 @@ package logger
const
(
Error
=
iota
+
2
Info
Core
Debug
Detail
)
whisper/whisper.go
View file @
18897271
...
...
@@ -168,7 +168,7 @@ func (self *Whisper) msgHandler(peer *p2p.Peer, ws p2p.MsgReadWriter) error {
for
_
,
envelope
:=
range
envelopes
{
if
err
:=
self
.
add
(
envelope
);
err
!=
nil
{
// TODO Punish peer here. Invalid envelope.
peer
.
Info
ln
(
err
)
peer
.
Debug
ln
(
err
)
}
wpeer
.
addKnown
(
envelope
)
}
...
...
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