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
1fe2d0d0
Commit
1fe2d0d0
authored
Sep 24, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Peers no longer take care of block processing
parent
54558dd8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
32 deletions
+2
-32
peer.go
peer.go
+2
-32
No files found.
peer.go
View file @
1fe2d0d0
...
...
@@ -517,16 +517,9 @@ func (p *Peer) HandleInbound() {
break
}
blockPool
.
AddHash
(
hash
)
blockPool
.
AddHash
(
hash
,
p
)
}
/*
if foundCommonHash || msg.Data.Len() == 0 {
p.FetchBlocks()
} else {
p.FetchHashes()
}
*/
if
!
foundCommonHash
&&
msg
.
Data
.
Len
()
!=
0
{
p
.
FetchHashes
()
}
...
...
@@ -545,22 +538,6 @@ func (p *Peer) HandleInbound() {
p
.
lastBlockReceived
=
time
.
Now
()
}
/*
var err error
blockPool.CheckLinkAndProcess(func(block *ethchain.Block) {
err = p.ethereum.StateManager().Process(block, false)
})
if err != nil {
peerlogger.Infoln(err)
} else {
// Don't trigger if there's just one block.
if blockPool.Len() != 0 && msg.Data.Len() > 1 {
p.FetchBlocks()
}
}
*/
}
}
}
...
...
@@ -608,13 +585,6 @@ out:
if
sinceBlock
>
5
*
time
.
Second
&&
sinceHash
>
5
*
time
.
Second
{
self
.
catchingUp
=
false
}
if
sinceHash
>
10
*
time
.
Second
&&
self
.
ethereum
.
blockPool
.
Len
()
!=
0
{
// XXX While this is completely and utterly incorrect, in order to do anything on the test net is to do it this way
// Assume that when fetching hashes timeouts, we are done.
//self.FetchHashes()
//self.FetchBlocks()
}
}
case
<-
self
.
quit
:
break
out
...
...
@@ -738,7 +708,7 @@ func (self *Peer) handleStatus(msg *ethwire.Msg) {
// Compare the total TD with the blockchain TD. If remote is higher
// fetch hashes from highest TD node.
if
self
.
td
.
Cmp
(
self
.
ethereum
.
BlockChain
()
.
TD
)
>
0
{
self
.
ethereum
.
blockPool
.
AddHash
(
self
.
lastReceivedHash
)
self
.
ethereum
.
blockPool
.
AddHash
(
self
.
lastReceivedHash
,
self
)
self
.
FetchHashes
()
}
...
...
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