Skip to content

Commit

Permalink
Merge pull request #459 from tnull/2025-02-quiet-reconnection-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull authored Feb 6, 2025
2 parents 801f6a6 + a1421d6 commit 5f0ab5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub(crate) const LDK_PAYMENT_RETRY_TIMEOUT: Duration = Duration::from_secs(10);
pub(crate) const RESOLVED_CHANNEL_MONITOR_ARCHIVAL_INTERVAL: u32 = 6;

// The time in-between peer reconnection attempts.
pub(crate) const PEER_RECONNECTION_INTERVAL: Duration = Duration::from_secs(10);
pub(crate) const PEER_RECONNECTION_INTERVAL: Duration = Duration::from_secs(60);

// The time in-between RGS sync attempts.
pub(crate) const RGS_SYNC_INTERVAL: Duration = Duration::from_secs(60 * 60);
Expand Down
28 changes: 10 additions & 18 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ use types::{
};
pub use types::{ChannelDetails, CustomTlvRecord, PeerDetails, UserChannelId};

use logger::{log_error, log_info, log_trace, LdkLogger, Logger};
use logger::{log_debug, log_error, log_info, log_trace, LdkLogger, Logger};

use lightning::chain::BestBlock;
use lightning::events::bump_transaction::Wallet as LdkWallet;
Expand Down Expand Up @@ -265,7 +265,7 @@ impl Node {
loop {
tokio::select! {
_ = stop_gossip_sync.changed() => {
log_trace!(
log_debug!(
gossip_sync_logger,
"Stopping background syncing RGS gossip data.",
);
Expand Down Expand Up @@ -344,7 +344,7 @@ impl Node {
let peer_mgr = Arc::clone(&peer_manager_connection_handler);
tokio::select! {
_ = stop_listen.changed() => {
log_trace!(
log_debug!(
listening_logger,
"Stopping listening to inbound connections.",
);
Expand Down Expand Up @@ -380,7 +380,7 @@ impl Node {
loop {
tokio::select! {
_ = stop_connect.changed() => {
log_trace!(
log_debug!(
connect_logger,
"Stopping reconnecting known peers.",
);
Expand All @@ -394,18 +394,10 @@ impl Node {
.collect::<Vec<_>>();

for peer_info in connect_peer_store.list_peers().iter().filter(|info| !pm_peers.contains(&info.node_id)) {
let res = connect_cm.do_connect_peer(
let _ = connect_cm.do_connect_peer(
peer_info.node_id,
peer_info.address.clone(),
).await;
match res {
Ok(_) => {
log_info!(connect_logger, "Successfully reconnected to peer {}", peer_info.node_id);
},
Err(e) => {
log_error!(connect_logger, "Failed to reconnect to peer {}: {}", peer_info.node_id, e);
}
}
}
}
}
Expand All @@ -431,7 +423,7 @@ impl Node {
loop {
tokio::select! {
_ = stop_bcast.changed() => {
log_trace!(
log_debug!(
bcast_logger,
"Stopping broadcasting node announcements.",
);
Expand Down Expand Up @@ -504,7 +496,7 @@ impl Node {
loop {
tokio::select! {
_ = stop_tx_bcast.changed() => {
log_trace!(
log_debug!(
tx_bcast_logger,
"Stopping broadcasting transactions.",
);
Expand Down Expand Up @@ -558,7 +550,7 @@ impl Node {
Box::pin(async move {
tokio::select! {
_ = stop.changed() => {
log_trace!(
log_debug!(
sleeper_logger,
"Stopping processing events.",
);
Expand Down Expand Up @@ -593,7 +585,7 @@ impl Node {
log_error!(background_error_logger, "Failed to process events: {}", e);
panic!("Failed to process events");
});
log_trace!(background_stop_logger, "Events processing stopped.",);
log_debug!(background_stop_logger, "Events processing stopped.",);

match event_handling_stopped_sender.send(()) {
Ok(_) => (),
Expand All @@ -616,7 +608,7 @@ impl Node {
loop {
tokio::select! {
_ = stop_liquidity_handler.changed() => {
log_trace!(
log_debug!(
liquidity_logger,
"Stopping processing liquidity events.",
);
Expand Down

0 comments on commit 5f0ab5d

Please sign in to comment.