diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-29 21:55:08 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-29 21:55:08 +0800 |
commit | d1d2b660dcc3c7539940a5e3d5a48ad10487bd8f (patch) | |
tree | 0bf03db6fb845ec2d432d37f16adcabb24bf82be /peer.go | |
parent | 8e7c4f91e33bd99d3a4d320cdc59cf0bab3831b6 (diff) | |
download | go-tangerine-d1d2b660dcc3c7539940a5e3d5a48ad10487bd8f.tar.gz go-tangerine-d1d2b660dcc3c7539940a5e3d5a48ad10487bd8f.tar.zst go-tangerine-d1d2b660dcc3c7539940a5e3d5a48ad10487bd8f.zip |
Prot
Diffstat (limited to 'peer.go')
-rw-r--r-- | peer.go | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -22,7 +22,7 @@ const ( // The size of the output buffer for writing messages outputBufferSize = 50 // Current protocol version - ProtocolVersion = 23 + ProtocolVersion = 25 // Interval for ping/pong message pingPongTimer = 2 * time.Second ) @@ -436,19 +436,20 @@ func (p *Peer) HandleInbound() { if err != nil { // If the parent is unknown try to catch up with this peer if ethchain.IsParentErr(err) { - /* - b := ethchain.NewBlockFromRlpValue(msg.Data.Get(0)) + b := ethchain.NewBlockFromRlpValue(msg.Data.Get(0)) + + peerlogger.Infof("Attempting to catch (%x). Parent unknown\n", b.Hash()) + p.catchingUp = false - peerlogger.Infof("Attempting to catch (%x). Parent known\n", b.Hash()) - p.catchingUp = false + p.CatchupWithPeer(b.Hash()) - p.CatchupWithPeer(b.Hash()) + peerlogger.Infoln(b) - peerlogger.Infoln(b) + /* + peerlogger.Infoln("Attempting to catch. Parent known") + p.catchingUp = false + p.CatchupWithPeer(p.ethereum.BlockChain().CurrentBlock.Hash()) */ - peerlogger.Infoln("Attempting to catch. Parent known") - p.catchingUp = false - p.CatchupWithPeer(p.ethereum.BlockChain().CurrentBlock.Hash()) } else if ethchain.IsValidationErr(err) { fmt.Println("Err:", err) p.catchingUp = false |