diff --git a/plugins/autopeering/protocol/outgoing_request_processor.go b/plugins/autopeering/protocol/outgoing_request_processor.go index 31fb40cf38a562cabba789b1a121b32958563c2b..88b95669ef2931d1b5d3080b42da70d7bf872242 100644 --- a/plugins/autopeering/protocol/outgoing_request_processor.go +++ b/plugins/autopeering/protocol/outgoing_request_processor.go @@ -3,6 +3,8 @@ package protocol import ( "time" + "github.com/iotaledger/goshimmer/packages/timeutil" + "github.com/iotaledger/goshimmer/packages/accountability" "github.com/iotaledger/goshimmer/packages/daemon" "github.com/iotaledger/goshimmer/packages/node" @@ -41,11 +43,7 @@ func createOutgoingRequestProcessor(plugin *node.Plugin) func() { func sendOutgoingRequests(plugin *node.Plugin) { for _, chosenNeighborCandidate := range chosenneighbors.CANDIDATES.Clone() { - select { - case <-daemon.ShutdownSignal: - return - case <-time.After(5 * time.Second): - } + timeutil.Sleep(5 * time.Second) if candidateShouldBeContacted(chosenNeighborCandidate) { if dialed, err := chosenNeighborCandidate.Send(outgoingrequest.INSTANCE.Marshal(), types.PROTOCOL_TYPE_TCP, true); err != nil {