Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
#[cfg(cycle_tests)]
use std::{any::Any, sync::Weak};

use crate::ffi::maybe_wrap;
pub use balance::{BalanceDetails, LightningBalance, PendingSweepBalance};
pub use bip39;
pub use bitcoin;
Expand Down Expand Up @@ -183,6 +182,7 @@ use types::{
pub use types::{ChannelDetails, CustomTlvRecord, PeerDetails, SyncAndAsyncKVStore, UserChannelId};
pub use vss_client;

use crate::ffi::maybe_wrap;
use crate::scoring::setup_background_pathfinding_scores_sync;
use crate::wallet::FundingAmount;

Expand Down
16 changes: 11 additions & 5 deletions tests/integration_tests_rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1570,14 +1570,20 @@ async fn test_node_announcement_propagation() {
expect_channel_ready_event!(node_a, node_b.node_id());
expect_channel_ready_event!(node_b, node_a.node_id());

// Wait until node_b broadcasts a node announcement
while node_b.status().latest_node_announcement_broadcast_timestamp.is_none() {
let has_node_announcement = |node: &ldk_node::Node, node_id: bitcoin::secp256k1::PublicKey| {
node.network_graph()
.node(&NodeId::from_pubkey(&node_id))
.map_or(false, |info| info.announcement_info.is_some())
};

while node_a.status().latest_node_announcement_broadcast_timestamp.is_none()
|| node_b.status().latest_node_announcement_broadcast_timestamp.is_none()
|| !has_node_announcement(&node_b, node_a.node_id())
|| !has_node_announcement(&node_a, node_b.node_id())
{
tokio::time::sleep(std::time::Duration::from_millis(10)).await;
}

// Sleep to make sure the node announcement propagates
tokio::time::sleep(std::time::Duration::from_secs(1)).await;

// Get node info from the other node's perspective
let node_a_info = node_b.network_graph().node(&NodeId::from_pubkey(&node_a.node_id())).unwrap();
let node_a_announcement_info = node_a_info.announcement_info.as_ref().unwrap();
Expand Down
Loading