Skip to content

Commit

Permalink
fixup! chore: upgrade to rust-lightning 0.0.116 and bump rust-dlc
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp Hoenisch <philipp@coblox.tech>
  • Loading branch information
bonomat committed Oct 19, 2023
1 parent 947198d commit c136039
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion coordinator/src/bin/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async fn main() -> Result<()> {
)?);

let event_handler = CoordinatorEventHandler::new(node.clone(), Some(node_event_sender));
let running = node.start(event_handler)?;
let running = node.start(event_handler, false)?;
let node = Node::new(node, running, pool.clone(), settings.to_node_settings());

// TODO: Pass the tokio metrics into Prometheus
Expand Down
11 changes: 8 additions & 3 deletions crates/ln-dlc-node/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,11 @@ where
/// Starts the background handles - if the returned handles are dropped, the
/// background tasks are stopped.
// TODO: Consider having handles for *all* the tasks & threads for a clean shutdown.
pub fn start(&self, event_handler: impl EventHandlerTrait + 'static) -> Result<RunningNode> {
pub fn start(
&self,
event_handler: impl EventHandlerTrait + 'static,
mobile_interruptable_platform: bool,
) -> Result<RunningNode> {
let mut handles = vec![spawn_connection_management(
self.peer_manager.clone(),
self.listen_address,
Expand Down Expand Up @@ -469,6 +473,7 @@ where
event_handler,
self.gossip_sync.clone(),
self.scorer.clone(),
mobile_interruptable_platform,
));

handles.push(spawn_broadcast_node_annoucements(
Expand Down Expand Up @@ -599,6 +604,7 @@ fn spawn_background_processor(
event_handler: impl EventHandlerTrait + 'static,
gossip_sync: Arc<NodeGossipSync>,
scorer: Arc<Mutex<Scorer>>,
mobile_interruptable_platform: bool,
) -> RemoteHandle<()> {
tracing::info!("Starting background processor");
let (fut, remote_handle) = async move {
Expand All @@ -617,8 +623,7 @@ fn spawn_background_processor(
false
})
},
// TODO: think about how to make this configurable per platform
true,
mobile_interruptable_platform,
)
.await
{
Expand Down
2 changes: 1 addition & 1 deletion crates/ln-dlc-node/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl Node<InMemoryStore> {
let node = Arc::new(node);

let event_handler = event_handler_factory(node.clone(), ldk_event_sender);
let running = node.start(event_handler)?;
let running = node.start(event_handler, false)?;

tracing::debug!(%name, info = %node.info, "Node started");

Expand Down
2 changes: 1 addition & 1 deletion maker/src/bin/maker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async fn main() -> Result<()> {
)?);

let event_handler = EventHandler::new(node.clone());
let _running_node = node.start(event_handler)?;
let _running_node = node.start(event_handler, false)?;

std::thread::spawn(node.sync_on_chain_wallet_periodically());

Expand Down
2 changes: 1 addition & 1 deletion mobile/native/src/ln_dlc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ pub fn run(data_dir: String, seed_dir: String, runtime: &Runtime) -> Result<()>
let node = Arc::new(node);

let event_handler = AppEventHandler::new(node.clone(), Some(event_sender));
let _running = node.start(event_handler)?;
let _running = node.start(event_handler, true)?;
let node = Arc::new(Node::new(node, _running));

// Refresh the wallet balance and history eagerly so that it can complete before the
Expand Down

0 comments on commit c136039

Please sign in to comment.