Skip to content

Commit

Permalink
bugfix: If you dont have a peer from the specific location, ask for p…
Browse files Browse the repository at this point in the history
…ending etx from random peer
  • Loading branch information
gameofpointers committed Sep 6, 2023
1 parent 3997a35 commit 9b2844c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions eth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,15 @@ func (h *handler) missingPendingEtxsLoop() {
}
// Check if any of the peers have the body
for _, peer := range peersRunningSlice {
log.Trace("Fetching the missing pending etxs from", "peer", peer.ID(), "hash", hashAndLocation.Hash)
peer.RequestOnePendingEtxs(hashAndLocation.Hash)
if len(peersRunningSlice) == 0 {
for _, peer := range h.selectSomePeers() {
log.Trace("Fetching the missing pending etxs from", "peer", peer.ID(), "hash", hashAndLocation.Hash)
peer.RequestOnePendingEtxs(hashAndLocation.Hash)
}
} else {
log.Trace("Fetching the missing pending etxs from", "peer", peer.ID(), "hash", hashAndLocation.Hash)
peer.RequestOnePendingEtxs(hashAndLocation.Hash)
}
}
case <-h.missingPendingEtxsSub.Err():
return
Expand Down

0 comments on commit 9b2844c

Please sign in to comment.