Only accept peers if we asked for them
This commit is contained in:
parent
5fcbaefd0b
commit
8fe0864680
4
peer.go
4
peer.go
|
@ -401,7 +401,7 @@ func (p *Peer) HandleInbound() {
|
||||||
case ethwire.MsgPeersTy:
|
case ethwire.MsgPeersTy:
|
||||||
// Received a list of peers (probably because MsgGetPeersTy was send)
|
// Received a list of peers (probably because MsgGetPeersTy was send)
|
||||||
// Only act on message if we actually requested for a peers list
|
// Only act on message if we actually requested for a peers list
|
||||||
//if p.requestedPeerList {
|
if p.requestedPeerList {
|
||||||
data := msg.Data
|
data := msg.Data
|
||||||
// Create new list of possible peers for the ethereum to process
|
// Create new list of possible peers for the ethereum to process
|
||||||
peers := make([]string, data.Len())
|
peers := make([]string, data.Len())
|
||||||
|
@ -416,7 +416,7 @@ func (p *Peer) HandleInbound() {
|
||||||
// Mark unrequested again
|
// Mark unrequested again
|
||||||
p.requestedPeerList = false
|
p.requestedPeerList = false
|
||||||
|
|
||||||
//}
|
}
|
||||||
case ethwire.MsgGetChainTy:
|
case ethwire.MsgGetChainTy:
|
||||||
var parent *ethchain.Block
|
var parent *ethchain.Block
|
||||||
// Length minus one since the very last element in the array is a count
|
// Length minus one since the very last element in the array is a count
|
||||||
|
|
Loading…
Reference in New Issue