eth, les: Refactor downloader peer to use structs
This commit is contained in:
@ -37,7 +37,7 @@ type stateReq struct {
|
||||
tasks map[common.Hash]*stateTask // Download tasks to track previous attempts
|
||||
timeout time.Duration // Maximum round trip time for this to complete
|
||||
timer *time.Timer // Timer to fire when the RTT timeout expires
|
||||
peer *peer // Peer that we're requesting from
|
||||
peer *peerConnection // Peer that we're requesting from
|
||||
response [][]byte // Response data of the peer (nil for timeouts)
|
||||
}
|
||||
|
||||
@ -246,7 +246,7 @@ func (s *stateSync) Cancel() error {
|
||||
// and timeouts.
|
||||
func (s *stateSync) loop() error {
|
||||
// Listen for new peer events to assign tasks to them
|
||||
newPeer := make(chan *peer, 1024)
|
||||
newPeer := make(chan *peerConnection, 1024)
|
||||
peerSub := s.d.peers.SubscribeNewPeers(newPeer)
|
||||
defer peerSub.Unsubscribe()
|
||||
|
||||
|
Reference in New Issue
Block a user