outbound_session: fix bug causing nodes to get stuck in peer discovery

ie. if we have gold or white connections we should try to connect to them.
This commit is contained in:
draoi
2024-04-07 16:43:31 +02:00
parent 7870d006d2
commit fe0801bcf1

View File

@@ -296,9 +296,12 @@ impl Slot {
self.slot,
);
// Do peer discovery if we don't have a hostlist (first time connecting
// to the network).
if hosts.container.is_empty(HostColor::Grey).await {
// Do peer discovery if we don't have any peers on the Grey, White or Gold list
// (first time connecting to the network).
if hosts.container.is_empty(HostColor::Grey).await &&
hosts.container.is_empty(HostColor::White).await &&
hosts.container.is_empty(HostColor::Gold).await
{
dnetev!(self, OutboundSlotSleeping, {
slot: self.slot,
});