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
4180ca7f
Commit
4180ca7f
authored
Jun 19, 2015
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth: fix the propagation/announce order for mined blocks
parent
e4f9ec88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
handler.go
eth/handler.go
+4
-4
No files found.
eth/handler.go
View file @
4180ca7f
...
@@ -6,7 +6,6 @@ import (
...
@@ -6,7 +6,6 @@ import (
"sync"
"sync"
"time"
"time"
"github.com/ethereum/go-ethereum/pow"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
...
@@ -16,6 +15,7 @@ import (
...
@@ -16,6 +15,7 @@ import (
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/pow"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rlp"
)
)
...
@@ -307,7 +307,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
...
@@ -307,7 +307,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
blocks
=
nil
blocks
=
nil
}
}
// Update the receive timestamp of each block
// Update the receive timestamp of each block
for
i
:=
0
;
i
<
len
(
blocks
);
i
++
{
for
i
:=
0
;
i
<
len
(
blocks
);
i
++
{
blocks
[
i
]
.
ReceivedAt
=
msg
.
ReceivedAt
blocks
[
i
]
.
ReceivedAt
=
msg
.
ReceivedAt
}
}
// Filter out any explicitly requested blocks, deliver the rest to the downloader
// Filter out any explicitly requested blocks, deliver the rest to the downloader
...
@@ -417,8 +417,8 @@ func (self *ProtocolManager) minedBroadcastLoop() {
...
@@ -417,8 +417,8 @@ func (self *ProtocolManager) minedBroadcastLoop() {
for
obj
:=
range
self
.
minedBlockSub
.
Chan
()
{
for
obj
:=
range
self
.
minedBlockSub
.
Chan
()
{
switch
ev
:=
obj
.
(
type
)
{
switch
ev
:=
obj
.
(
type
)
{
case
core
.
NewMinedBlockEvent
:
case
core
.
NewMinedBlockEvent
:
self
.
BroadcastBlock
(
ev
.
Block
,
false
)
self
.
BroadcastBlock
(
ev
.
Block
,
true
)
// First propagate block to peers
self
.
BroadcastBlock
(
ev
.
Block
,
true
)
self
.
BroadcastBlock
(
ev
.
Block
,
false
)
// Only then announce to the rest
}
}
}
}
}
}
...
...
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