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
0ee0094c
Commit
0ee0094c
authored
Mar 23, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better block propagation
parent
7b8a47f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
chain_manager.go
core/chain_manager.go
+2
-2
backend.go
eth/backend.go
+2
-2
No files found.
core/chain_manager.go
View file @
0ee0094c
...
...
@@ -8,11 +8,11 @@ import (
"sync"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/core/state"
)
var
(
...
...
@@ -523,7 +523,7 @@ out:
case
ChainEvent
:
// We need some control over the mining operation. Acquiring locks and waiting for the miner to create new block takes too long
// and in most cases isn't even necessary.
if
i
==
ev
.
canonicalCount
{
if
i
+
1
==
ev
.
canonicalCount
{
self
.
eventMux
.
Post
(
ChainHeadEvent
{
event
.
Block
})
}
case
ChainSplitEvent
:
...
...
eth/backend.go
View file @
0ee0094c
...
...
@@ -355,7 +355,7 @@ func (s *Ethereum) Start() error {
go
s
.
txBroadcastLoop
()
// broadcast mined blocks
s
.
blockSub
=
s
.
eventMux
.
Subscribe
(
core
.
NewMinedBlock
Event
{})
s
.
blockSub
=
s
.
eventMux
.
Subscribe
(
core
.
ChainHead
Event
{})
go
s
.
blockBroadcastLoop
()
servlogger
.
Infoln
(
"Server started"
)
...
...
@@ -421,7 +421,7 @@ func (self *Ethereum) blockBroadcastLoop() {
// automatically stops if unsubscribe
for
obj
:=
range
self
.
blockSub
.
Chan
()
{
switch
ev
:=
obj
.
(
type
)
{
case
core
.
NewMinedBlock
Event
:
case
core
.
ChainHead
Event
:
self
.
net
.
Broadcast
(
"eth"
,
NewBlockMsg
,
[]
interface
{}{
ev
.
Block
,
ev
.
Block
.
Td
})
}
}
...
...
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