Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions crates/floresta-wire/src/p2p_wire/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,9 @@ where
required_service: ServiceFlags,
) -> Result<(), WireError> {
// If the user passes in a `--connect` cli argument, we only connect with
// that particular peer.
// that particular peer, but not having any peers means that we didnt tried to
// connect to it yet or the connection failed.

if self.fixed_peer.is_some() && !self.peers.is_empty() {
return Ok(());
}
Expand All @@ -1851,8 +1853,8 @@ where
}

pub(crate) fn open_feeler_connection(&mut self) -> Result<(), WireError> {
// No feeler if `-connect` is set
if self.fixed_peer.is_some() {
// No feeler if `-connect` is set or when Regtest mode.
if self.fixed_peer.is_some() || self.network == Network::Regtest {
return Ok(());
}
self.create_connection(ConnectionKind::Feeler)?;
Expand Down Expand Up @@ -1908,6 +1910,9 @@ where
let net = self.network;
self.address_man.add_fixed_addresses(net);

if self.network == Network::Regtest {
return Ok(());
}
return Err(WireError::NoAddressesAvailable);
};

Expand Down