diff options
-rw-r--r-- | ethereum.go | 12 | ||||
-rw-r--r-- | peer.go | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/ethereum.go b/ethereum.go index 94e338c56..83a74f302 100644 --- a/ethereum.go +++ b/ethereum.go @@ -138,6 +138,18 @@ func (s *Ethereum) IsMining() bool { func (s *Ethereum) PeerCount() int { 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 { return s.listening } @@ -389,6 +389,8 @@ func (p *Peer) HandleInbound() { p.CatchupWithPeer(p.ethereum.BlockChain().CurrentBlock.Hash()) } } + + p.catchingUp = false case ethwire.MsgTxTy: // If the message was a transaction queue the transaction // in the TxPool where it will undergo validation and |