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
5948adfa
Commit
5948adfa
authored
Mar 05, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added eth.chain.received.new_block
parent
fbb307cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
protocol.go
eth/protocol.go
+8
-0
types.go
logger/types.go
+5
-5
No files found.
eth/protocol.go
View file @
5948adfa
...
@@ -224,6 +224,14 @@ func (self *ethProtocol) handle() error {
...
@@ -224,6 +224,14 @@ func (self *ethProtocol) handle() error {
return
self
.
protoError
(
ErrDecode
,
"msg %v: %v"
,
msg
,
err
)
return
self
.
protoError
(
ErrDecode
,
"msg %v: %v"
,
msg
,
err
)
}
}
hash
:=
request
.
Block
.
Hash
()
hash
:=
request
.
Block
.
Hash
()
_
,
chainHead
,
_
:=
self
.
chainManager
.
Status
()
jsonlogger
.
LogJson
(
&
logger
.
EthChainReceivedNewBlock
{
BlockHash
:
ethutil
.
Bytes2Hex
(
hash
),
BlockNumber
:
request
.
Block
.
Number
(),
// this surely must be zero
ChainHeadHash
:
ethutil
.
Bytes2Hex
(
chainHead
),
BlockPrevHash
:
ethutil
.
Bytes2Hex
(
request
.
Block
.
ParentHash
()),
RemoteId
:
self
.
peer
.
ID
()
.
String
(),
})
// to simplify backend interface adding a new block
// to simplify backend interface adding a new block
// uses AddPeer followed by AddHashes, AddBlock only if peer is the best peer
// uses AddPeer followed by AddHashes, AddBlock only if peer is the best peer
// (or selected as new best peer)
// (or selected as new best peer)
...
...
logger/types.go
View file @
5948adfa
...
@@ -66,11 +66,11 @@ func (l *EthMinerNewBlock) EventName() string {
...
@@ -66,11 +66,11 @@ func (l *EthMinerNewBlock) EventName() string {
}
}
type
EthChainReceivedNewBlock
struct
{
type
EthChainReceivedNewBlock
struct
{
BlockHash
string
`json:"block_hash"`
BlockHash
string
`json:"block_hash"`
BlockNumber
int
`json:"block_number"`
BlockNumber
*
big
.
Int
`json:"block_number"`
ChainHeadHash
string
`json:"chain_head_hash"`
ChainHeadHash
string
`json:"chain_head_hash"`
BlockPrevHash
string
`json:"block_prev_hash"`
BlockPrevHash
string
`json:"block_prev_hash"`
RemoteId
int
`json:"remote_id"`
RemoteId
string
`json:"remote_id"`
LogEvent
LogEvent
}
}
...
...
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