diff options
author | Maran <maran.hidskes@gmail.com> | 2014-05-26 17:47:47 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-05-26 17:47:47 +0800 |
commit | 24a6d87c3f4bc69fdd1c619b36f8b74a61fd8bae (patch) | |
tree | a30dc63ada2e32609b07a8b2bfb70409908c678a | |
parent | 4c7bd75c1a4ccbed09a10c81dbfbbcffdc66c411 (diff) | |
download | dexon-24a6d87c3f4bc69fdd1c619b36f8b74a61fd8bae.tar.gz dexon-24a6d87c3f4bc69fdd1c619b36f8b74a61fd8bae.tar.zst dexon-24a6d87c3f4bc69fdd1c619b36f8b74a61fd8bae.zip |
Don't handshake if there is no key yet; first start on Ethereal
-rw-r--r-- | peer.go | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -531,13 +531,16 @@ func (p *Peer) Stop() { } func (p *Peer) pushHandshake() error { - pubkey := ethutil.GetKeyRing().Get(0).PublicKey + keyRing := ethutil.GetKeyRing().Get(0) + if keyRing != nil { + pubkey := keyRing.PublicKey - msg := ethwire.NewMessage(ethwire.MsgHandshakeTy, []interface{}{ - uint32(ProtocolVersion), uint32(0), p.Version, byte(p.caps), p.port, pubkey[1:], - }) + msg := ethwire.NewMessage(ethwire.MsgHandshakeTy, []interface{}{ + uint32(ProtocolVersion), uint32(0), p.Version, byte(p.caps), p.port, pubkey[1:], + }) - p.QueueMessage(msg) + p.QueueMessage(msg) + } return nil } |