diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-24 18:04:15 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-24 18:04:15 +0800 |
commit | 32d125131f602d63f66ee7eb09439074f0b94a91 (patch) | |
tree | de8cdb558d390f8200962af2d24d4402b6762409 /peer.go | |
parent | 958b482ada677028e11698c219ed5b1e70b224e6 (diff) | |
download | dexon-32d125131f602d63f66ee7eb09439074f0b94a91.tar dexon-32d125131f602d63f66ee7eb09439074f0b94a91.tar.gz dexon-32d125131f602d63f66ee7eb09439074f0b94a91.tar.bz2 dexon-32d125131f602d63f66ee7eb09439074f0b94a91.tar.lz dexon-32d125131f602d63f66ee7eb09439074f0b94a91.tar.xz dexon-32d125131f602d63f66ee7eb09439074f0b94a91.tar.zst dexon-32d125131f602d63f66ee7eb09439074f0b94a91.zip |
Refactored to new state and vm
Diffstat (limited to 'peer.go')
-rw-r--r-- | peer.go | 27 |
1 files changed, 12 insertions, 15 deletions
@@ -470,23 +470,20 @@ func (p *Peer) HandleInbound() { p.pushPeers() case ethwire.MsgPeersTy: // Received a list of peers (probably because MsgGetPeersTy was send) - // Only act on message if we actually requested for a peers list - if p.requestedPeerList { - data := msg.Data - // Create new list of possible peers for the ethereum to process - peers := make([]string, data.Len()) - // Parse each possible peer - for i := 0; i < data.Len(); i++ { - value := data.Get(i) - peers[i] = unpackAddr(value.Get(0), value.Get(1).Uint()) - } + data := msg.Data + // Create new list of possible peers for the ethereum to process + peers := make([]string, data.Len()) + // Parse each possible peer + for i := 0; i < data.Len(); i++ { + value := data.Get(i) + peers[i] = unpackAddr(value.Get(0), value.Get(1).Uint()) + } - // Connect to the list of peers - p.ethereum.ProcessPeerList(peers) - // Mark unrequested again - p.requestedPeerList = false + // Connect to the list of peers + p.ethereum.ProcessPeerList(peers) + // Mark unrequested again + p.requestedPeerList = false - } case ethwire.MsgGetChainTy: var parent *ethchain.Block // Length minus one since the very last element in the array is a count |