From 9b2844c15afd6f0e3921b01bff33538198b253ca Mon Sep 17 00:00:00 2001 From: gop Date: Wed, 6 Sep 2023 12:47:21 -0500 Subject: [PATCH] bugfix: If you dont have a peer from the specific location, ask for pending etx from random peer --- eth/handler.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/eth/handler.go b/eth/handler.go index 0b338cad5a..bdad80dc12 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -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