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
9e63798d
Commit
9e63798d
authored
10 years ago
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/types, eth: meassure and display propagation times
parent
f8c27d71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
block.go
core/types/block.go
+2
-0
handler.go
eth/handler.go
+3
-1
No files found.
core/types/block.go
View file @
9e63798d
...
...
@@ -99,6 +99,8 @@ type Block struct {
Td
*
big
.
Int
queued
bool
// flag for blockpool to skip TD check
ReceivedAt
time
.
Time
receipts
Receipts
}
...
...
This diff is collapsed.
Click to expand it.
eth/handler.go
View file @
9e63798d
...
...
@@ -346,6 +346,8 @@ func (self *ProtocolManager) handleMsg(p *peer) error {
if
err
:=
request
.
Block
.
ValidateFields
();
err
!=
nil
{
return
errResp
(
ErrDecode
,
"block validation %v: %v"
,
msg
,
err
)
}
request
.
Block
.
ReceivedAt
=
time
.
Now
()
hash
:=
request
.
Block
.
Hash
()
// Add the block hash as a known hash to the peer. This will later be used to determine
// who should receive this.
...
...
@@ -419,7 +421,7 @@ func (pm *ProtocolManager) BroadcastBlock(hash common.Hash, block *types.Block)
for
_
,
peer
:=
range
peers
{
peer
.
sendNewBlock
(
block
)
}
glog
.
V
(
logger
.
Detail
)
.
Infoln
(
"broadcast block to"
,
len
(
peers
),
"peers
"
)
glog
.
V
(
logger
.
Detail
)
.
Infoln
(
"broadcast block to"
,
len
(
peers
),
"peers
. Total propagation time:"
,
time
.
Since
(
block
.
ReceivedAt
)
)
}
// BroadcastTx will propagate the block to its connected peers. It will sort
...
...
This diff is collapsed.
Click to expand it.
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