From: Matt Corallo <649246+TheBlueMatt@users.noreply.github.com> Date: Tue, 4 Jun 2024 19:10:43 +0000 (-0700) Subject: Merge pull request #3060 from TheBlueMatt/2024-05-parallel-async-om-events X-Git-Tag: v0.0.124-beta~100 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=3cd1cb5946128cbf28db1a33b7eadb6aeb36fe2b;p=rust-lightning Merge pull request #3060 from TheBlueMatt/2024-05-parallel-async-om-events Add a parallel async event handler to OnionMessenger and pass it directly to BackgroundProcessor --- 3cd1cb5946128cbf28db1a33b7eadb6aeb36fe2b diff --cc lightning-background-processor/src/lib.rs index 8b5591372,6b7cd5b05..4719d7e5c --- a/lightning-background-processor/src/lib.rs +++ b/lightning-background-processor/src/lib.rs @@@ -1655,11 -1653,10 +1655,11 @@@ mod tests _ => panic!("Unexpected event: {:?}", event), }; let persister = Arc::new(Persister::new(data_dir)); - let bg_processor = BackgroundProcessor::start(persister, event_handler, nodes[0].chain_monitor.clone(), nodes[0].node.clone(), nodes[0].no_gossip_sync(), nodes[0].peer_manager.clone(), nodes[0].logger.clone(), Some(nodes[0].scorer.clone())); + let bg_processor = BackgroundProcessor::start(persister, event_handler, nodes[0].chain_monitor.clone(), nodes[0].node.clone(), Some(nodes[0].messenger.clone()), nodes[0].no_gossip_sync(), nodes[0].peer_manager.clone(), nodes[0].logger.clone(), Some(nodes[0].scorer.clone())); // Force close the channel and check that the SpendableOutputs event was handled. - nodes[0].node.force_close_broadcasting_latest_txn(&nodes[0].node.list_channels()[0].channel_id, &nodes[1].node.get_our_node_id()).unwrap(); + let error_message = "Channel force-closed"; + nodes[0].node.force_close_broadcasting_latest_txn(&nodes[0].node.list_channels()[0].channel_id, &nodes[1].node.get_our_node_id(), error_message.to_string()).unwrap(); let commitment_tx = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().pop().unwrap(); confirm_transaction_depth(&mut nodes[0], &commitment_tx, BREAKDOWN_TIMEOUT as u32); diff --cc lightning/src/ln/msgs.rs index 3b52ff0de,7a6ba09c2..3e0627aac --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@@ -52,10 -52,10 +52,10 @@@ use core::fmt::Display use crate::io::{self, Cursor, Read}; use crate::io_extras::read_to_end; - use crate::events::{EventsProvider, MessageSendEventsProvider}; + use crate::events::MessageSendEventsProvider; use crate::crypto::streams::ChaChaPolyReadAdapter; use crate::util::logger; -use crate::util::ser::{LengthReadable, LengthReadableArgs, Readable, ReadableArgs, Writeable, Writer, WithoutLength, FixedLengthReader, HighZeroBytesDroppedBigSize, Hostname, TransactionU16LenLimited, BigSize}; +use crate::util::ser::{BigSize, FixedLengthReader, HighZeroBytesDroppedBigSize, Hostname, LengthRead, LengthReadable, LengthReadableArgs, Readable, ReadableArgs, TransactionU16LenLimited, WithoutLength, Writeable, Writer}; use crate::util::base32; use crate::routing::gossip::{NodeAlias, NodeId};