node: Fix connection attempt tracking
When a DNS error occured, the `dial` call failed and we didn't get a connection attempt, just a disconnect. We fix that by always calling back into the service when we attempt a connection.
This commit is contained in:
parent
0fbfbc5721
commit
7b3d380ceb
|
|
@ -773,6 +773,7 @@ where
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
self.service.attempted(node_id, addr.clone());
|
||||||
|
|
||||||
match dial::<G>(
|
match dial::<G>(
|
||||||
addr.to_inner(),
|
addr.to_inner(),
|
||||||
|
|
@ -785,7 +786,6 @@ where
|
||||||
NetTransport::<WireSession<G>>::with_session(session, Link::Outbound)
|
NetTransport::<WireSession<G>>::with_session(session, Link::Outbound)
|
||||||
}) {
|
}) {
|
||||||
Ok(transport) => {
|
Ok(transport) => {
|
||||||
self.service.attempted(node_id, addr.clone());
|
|
||||||
self.outbound.insert(
|
self.outbound.insert(
|
||||||
transport.as_raw_fd(),
|
transport.as_raw_fd(),
|
||||||
Outbound {
|
Outbound {
|
||||||
|
|
@ -798,7 +798,7 @@ where
|
||||||
.push_back(reactor::Action::RegisterTransport(transport));
|
.push_back(reactor::Action::RegisterTransport(transport));
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
log::error!(target: "wire", "Error establishing connection: {err}");
|
log::error!(target: "wire", "Error establishing connection to {addr}: {err}");
|
||||||
|
|
||||||
self.service
|
self.service
|
||||||
.disconnected(node_id, &DisconnectReason::Dial(Arc::new(err)));
|
.disconnected(node_id, &DisconnectReason::Dial(Arc::new(err)));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue