Commit 65f57027 authored by obscuren's avatar obscuren

Fixed catching up

parent a6b9ea05
...@@ -321,8 +321,6 @@ func (p *Peer) HandleInbound() { ...@@ -321,8 +321,6 @@ func (p *Peer) HandleInbound() {
// We don't have this block, but we do have a block with the same prevHash, diversion time! // We don't have this block, but we do have a block with the same prevHash, diversion time!
if p.ethereum.StateManager().BlockChain().HasBlockWithPrevHash(block.PrevHash) { if p.ethereum.StateManager().BlockChain().HasBlockWithPrevHash(block.PrevHash) {
if p.ethereum.StateManager().BlockChain().FindCanonicalChainFromMsg(msg, block.PrevHash) { if p.ethereum.StateManager().BlockChain().FindCanonicalChainFromMsg(msg, block.PrevHash) {
p.catchingUp = false
return return
} }
} }
...@@ -373,12 +371,11 @@ func (p *Peer) HandleInbound() { ...@@ -373,12 +371,11 @@ func (p *Peer) HandleInbound() {
} }
} }
if lastBlock != nil && err == nil { if msg.Data.Len() == 0 {
fmt.Println("Did proc. no err") // Set catching up to false if
} else { // the peer has nothing left to give
fmt.Println("other") p.catchingUp = false
} }
fmt.Println("length of chain", msg.Data.Len())
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment