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
ec6ec62d
Commit
ec6ec62d
authored
Mar 24, 2014
by
Maran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some xtra logs
parent
97786d03
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
6 deletions
+3
-6
dagger.go
ethchain/dagger.go
+2
-2
state_manager.go
ethchain/state_manager.go
+0
-3
peer.go
peer.go
+1
-1
No files found.
ethchain/dagger.go
View file @
ec6ec62d
...
@@ -29,14 +29,14 @@ func (pow *EasyPow) Search(block *Block, reactChan chan ethutil.React) []byte {
...
@@ -29,14 +29,14 @@ func (pow *EasyPow) Search(block *Block, reactChan chan ethutil.React) []byte {
for
{
for
{
select
{
select
{
case
<-
reactChan
:
case
<-
reactChan
:
log
.
Println
(
"[
pow
] Received reactor event; breaking out."
)
log
.
Println
(
"[
POW
] Received reactor event; breaking out."
)
return
nil
return
nil
default
:
default
:
i
++
i
++
if
i
%
1234567
==
0
{
if
i
%
1234567
==
0
{
elapsed
:=
time
.
Now
()
.
UnixNano
()
-
start
elapsed
:=
time
.
Now
()
.
UnixNano
()
-
start
hashes
:=
((
float64
(
1e9
)
/
float64
(
elapsed
))
*
float64
(
i
))
/
1000
hashes
:=
((
float64
(
1e9
)
/
float64
(
elapsed
))
*
float64
(
i
))
/
1000
log
.
Println
(
"Hashing @"
,
int64
(
hashes
),
"khash"
)
log
.
Println
(
"
[POW]
Hashing @"
,
int64
(
hashes
),
"khash"
)
}
}
sha
:=
ethutil
.
Sha3Bin
(
big
.
NewInt
(
r
.
Int63
())
.
Bytes
())
sha
:=
ethutil
.
Sha3Bin
(
big
.
NewInt
(
r
.
Int63
())
.
Bytes
())
...
...
ethchain/state_manager.go
View file @
ec6ec62d
...
@@ -214,9 +214,6 @@ func (sm *StateManager) CalculateTD(block *Block) bool {
...
@@ -214,9 +214,6 @@ func (sm *StateManager) CalculateTD(block *Block) bool {
// The new TD will only be accepted if the new difficulty is
// The new TD will only be accepted if the new difficulty is
// is greater than the previous.
// is greater than the previous.
fmt
.
Println
(
"new block td:"
,
td
)
fmt
.
Println
(
"cur block td:"
,
sm
.
bc
.
TD
)
if
td
.
Cmp
(
sm
.
bc
.
TD
)
>
0
{
if
td
.
Cmp
(
sm
.
bc
.
TD
)
>
0
{
// Set the new total difficulty back to the block chain
// Set the new total difficulty back to the block chain
sm
.
bc
.
SetTotalDifficulty
(
td
)
sm
.
bc
.
SetTotalDifficulty
(
td
)
...
...
peer.go
View file @
ec6ec62d
...
@@ -316,7 +316,7 @@ func (p *Peer) HandleInbound() {
...
@@ -316,7 +316,7 @@ func (p *Peer) HandleInbound() {
// 4. No: Let's request more blocks back.
// 4. No: Let's request more blocks back.
// Make sure we are actually receiving anything
// Make sure we are actually receiving anything
if
msg
.
Data
.
Len
()
-
1
>
1
{
if
msg
.
Data
.
Len
()
-
1
>
1
&&
p
.
catchingUp
{
// We requested blocks and now we need to make sure we have a common ancestor somewhere in these blocks so we can find
// We requested blocks and now we need to make sure we have a common ancestor somewhere in these blocks so we can find
// common ground to start syncing from
// common ground to start syncing from
lastBlock
=
ethchain
.
NewBlockFromRlpValue
(
msg
.
Data
.
Get
(
msg
.
Data
.
Len
()
-
1
))
lastBlock
=
ethchain
.
NewBlockFromRlpValue
(
msg
.
Data
.
Get
(
msg
.
Data
.
Len
()
-
1
))
...
...
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