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
3ac74b1e
Commit
3ac74b1e
authored
May 14, 2014
by
Maran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented IsUpToDate to mark the node as ready to start mining
parent
0512113b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
ethereum.go
ethereum.go
+12
-0
peer.go
peer.go
+2
-0
No files found.
ethereum.go
View file @
3ac74b1e
...
@@ -138,6 +138,18 @@ func (s *Ethereum) IsMining() bool {
...
@@ -138,6 +138,18 @@ func (s *Ethereum) IsMining() bool {
func
(
s
*
Ethereum
)
PeerCount
()
int
{
func
(
s
*
Ethereum
)
PeerCount
()
int
{
return
s
.
peers
.
Len
()
return
s
.
peers
.
Len
()
}
}
func
(
s
*
Ethereum
)
IsUpToDate
()
bool
{
upToDate
:=
true
eachPeer
(
s
.
peers
,
func
(
peer
*
Peer
,
e
*
list
.
Element
)
{
if
atomic
.
LoadInt32
(
&
peer
.
connected
)
==
1
{
if
peer
.
catchingUp
==
true
{
upToDate
=
false
}
}
})
return
upToDate
}
func
(
s
*
Ethereum
)
IsListening
()
bool
{
func
(
s
*
Ethereum
)
IsListening
()
bool
{
return
s
.
listening
return
s
.
listening
}
}
...
...
peer.go
View file @
3ac74b1e
...
@@ -389,6 +389,8 @@ func (p *Peer) HandleInbound() {
...
@@ -389,6 +389,8 @@ func (p *Peer) HandleInbound() {
p
.
CatchupWithPeer
(
p
.
ethereum
.
BlockChain
()
.
CurrentBlock
.
Hash
())
p
.
CatchupWithPeer
(
p
.
ethereum
.
BlockChain
()
.
CurrentBlock
.
Hash
())
}
}
}
}
p
.
catchingUp
=
false
case
ethwire
.
MsgTxTy
:
case
ethwire
.
MsgTxTy
:
// If the message was a transaction queue the transaction
// If the message was a transaction queue the transaction
// in the TxPool where it will undergo validation and
// in the TxPool where it will undergo validation and
...
...
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