From f6afb6c904e2ef2e3173633a2b462ec6dada13b6 Mon Sep 17 00:00:00 2001 From: Fmt Bot Date: Sun, 1 Mar 2026 00:49:25 +0000 Subject: [PATCH] 2026-03-01 automated rustfmt nightly --- src/builder.rs | 3 +-- src/config.rs | 10 +++++----- src/event.rs | 2 +- src/io/sqlite_store/mod.rs | 1 - src/io/vss_store.rs | 10 +++++----- src/lib.rs | 17 ++++++++++------- src/payment/store.rs | 5 ++--- tests/common/mod.rs | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 6d0d9e8ad..b35259f1c 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -19,6 +19,7 @@ use bip39::Mnemonic; use bitcoin::bip32::{ChildNumber, Xpriv}; use bitcoin::secp256k1::PublicKey; use bitcoin::{BlockHash, Network}; +use chrono::Local; use lightning::chain::{chainmonitor, BestBlock, Watch}; use lightning::io::Cursor; use lightning::ln::channelmanager::{self, ChainParameters, ChannelManagerReadArgs}; @@ -40,7 +41,6 @@ use lightning::util::persist::{ SCORER_PERSISTENCE_KEY, SCORER_PERSISTENCE_PRIMARY_NAMESPACE, SCORER_PERSISTENCE_SECONDARY_NAMESPACE, }; - use lightning::util::ser::ReadableArgs; use lightning::util::sweep::OutputSweeper; use lightning_persister::fs_store::FilesystemStore; @@ -84,7 +84,6 @@ use crate::types::{ use crate::wallet::persist::KVStoreWalletPersister; use crate::wallet::Wallet; use crate::{Node, NodeMetrics}; -use chrono::Local; const VSS_HARDENED_CHILD_INDEX: u32 = 877; const VSS_LNURL_AUTH_HARDENED_CHILD_INDEX: u32 = 138; diff --git a/src/config.rs b/src/config.rs index 5ed1d1e12..44e5f0282 100644 --- a/src/config.rs +++ b/src/config.rs @@ -75,22 +75,22 @@ pub(crate) const NODE_ANN_BCAST_INTERVAL: Duration = Duration::from_secs(60 * 60 pub(crate) const WALLET_SYNC_INTERVAL_MINIMUM_SECS: u64 = 10; // The timeout after which we abort a wallet syncing operation. -pub(crate) const BDK_WALLET_SYNC_TIMEOUT_SECS: u64 = 90; //40; //20; // Alby: larger timeouts are needed after multiple FC +pub(crate) const BDK_WALLET_SYNC_TIMEOUT_SECS: u64 = 90; // 40; //20; // Alby: larger timeouts are needed after multiple FC // The timeout after which we abort a wallet syncing operation. -pub(crate) const LDK_WALLET_SYNC_TIMEOUT_SECS: u64 = 90; //40; //10; // Alby: larger timeouts are needed after multiple FC +pub(crate) const LDK_WALLET_SYNC_TIMEOUT_SECS: u64 = 90; // 40; //10; // Alby: larger timeouts are needed after multiple FC // The timeout after which we give up waiting on LDK's event handler to exit on shutdown. pub(crate) const LDK_EVENT_HANDLER_SHUTDOWN_TIMEOUT_SECS: u64 = 60; // 30; // The timeout after which we give up waiting on a background task to exit on shutdown. -pub(crate) const BACKGROUND_TASK_SHUTDOWN_TIMEOUT_SECS: u64 = 20; //5; +pub(crate) const BACKGROUND_TASK_SHUTDOWN_TIMEOUT_SECS: u64 = 20; // 5; // The timeout after which we abort a fee rate cache update operation. -pub(crate) const FEE_RATE_CACHE_UPDATE_TIMEOUT_SECS: u64 = 10; //5; +pub(crate) const FEE_RATE_CACHE_UPDATE_TIMEOUT_SECS: u64 = 10; // 5; // The timeout after which we abort a transaction broadcast operation. -pub(crate) const TX_BROADCAST_TIMEOUT_SECS: u64 = 10; //5; +pub(crate) const TX_BROADCAST_TIMEOUT_SECS: u64 = 10; // 5; // The timeout after which we abort a RGS sync operation. pub(crate) const RGS_SYNC_TIMEOUT_SECS: u64 = 5; diff --git a/src/event.rs b/src/event.rs index d33c73d2e..5c0b943bd 100644 --- a/src/event.rs +++ b/src/event.rs @@ -1056,7 +1056,7 @@ where preimage: Some(Some(payment_preimage)), fee_paid_msat: Some(fee_paid_msat), status: Some(PaymentStatus::Succeeded), - //fee_msat: Some(fee_paid_msat), + // fee_msat: Some(fee_paid_msat), ..PaymentDetailsUpdate::new(payment_id) }; diff --git a/src/io/sqlite_store/mod.rs b/src/io/sqlite_store/mod.rs index 337211584..63a93155d 100644 --- a/src/io/sqlite_store/mod.rs +++ b/src/io/sqlite_store/mod.rs @@ -16,7 +16,6 @@ use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Mutex}; use lightning::io; - use lightning::util::persist::{ KVStore, KVStoreSync, NETWORK_GRAPH_PERSISTENCE_KEY, NETWORK_GRAPH_PERSISTENCE_PRIMARY_NAMESPACE, NETWORK_GRAPH_PERSISTENCE_SECONDARY_NAMESPACE, diff --git a/src/io/vss_store.rs b/src/io/vss_store.rs index 84c027787..459f04962 100644 --- a/src/io/vss_store.rs +++ b/src/io/vss_store.rs @@ -112,11 +112,11 @@ impl VssStore { let key_obfuscator = KeyObfuscator::new(obfuscation_master_key); let sync_retry_policy = retry_policy(); - /*let blocking_client = VssClient::new_with_headers( - base_url.clone(), - sync_retry_policy, - header_provider.clone(), - );*/ + // let blocking_client = VssClient::new_with_headers( + // base_url.clone(), + // sync_retry_policy, + // header_provider.clone(), + // ); // Alby: use longer timeouts for VSS (rather than default 10 seconds) const ALBY_REQWEST_CLIENT_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(60); let client_with_custom_timeouts = reqwest::Client::builder() diff --git a/src/lib.rs b/src/lib.rs index 995f1318f..6deb300a9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -109,6 +109,8 @@ use std::sync::{Arc, Mutex, RwLock}; use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; pub use balance::{BalanceDetails, LightningBalance, PendingSweepBalance}; +pub use bip39; +pub use bitcoin; use bitcoin::secp256k1::PublicKey; use bitcoin::{Address, Amount}; #[cfg(feature = "uniffi")] @@ -133,6 +135,7 @@ use gossip::GossipSource; use graph::NetworkGraph; pub use io::utils::generate_entropy_mnemonic; use io::utils::write_node_metrics; +pub use lightning; use lightning::chain::BestBlock; use lightning::events::bump_transaction::{Input, Wallet as LdkWallet}; use lightning::impl_writeable_tlv_based; @@ -144,6 +147,9 @@ use lightning::ln::msgs::SocketAddress; use lightning::routing::gossip::NodeAlias; use lightning::util::persist::KVStoreSync; use lightning_background_processor::process_events_async; +pub use lightning_invoice; +pub use lightning_liquidity; +pub use lightning_types; use liquidity::{LSPS1Liquidity, LiquiditySource}; use logger::{log_debug, log_error, log_info, log_trace, LdkLogger, Logger}; use payment::asynchronous::om_mailbox::OnionMessageMailbox; @@ -153,9 +159,9 @@ use payment::{ UnifiedQrPayment, }; use peer_store::{PeerInfo, PeerStore}; - use rand::Rng; use runtime::Runtime; +pub use tokio; use types::{ Broadcaster, BumpTransactionEventHandler, ChainMonitor, ChannelManager, Graph, KeysManager, OnionMessenger, PaymentStore, PeerManager, Router, Scorer, Sweeper, Wallet, @@ -164,13 +170,9 @@ pub use types::{ ChannelDetails, ChannelMonitorSizeInfo, CustomTlvRecord, DynStore, PeerDetails, SyncAndAsyncKVStore, UserChannelId, WordCount, }; -pub use { - bip39, bitcoin, lightning, lightning_invoice, lightning_liquidity, lightning_types, tokio, - vss_client, -}; +pub use vss_client; use crate::scoring::setup_background_pathfinding_scores_sync; - use crate::types::KeyValue; pub use crate::types::{MigrateStorage, ResetState, TlvEntry}; @@ -1055,9 +1057,10 @@ impl Node { /// we use this to be able to notify users when their channel monitors are getting too large /// (a risk that reading/writing to VSS could start taking too long) pub fn list_channel_monitor_sizes(&self) -> Vec { - use lightning::util::ser::Writeable; use std::ops::Deref; + use lightning::util::ser::Writeable; + let mut channel_sizes = Vec::new(); for channel_id in self.chain_monitor.list_monitors() { diff --git a/src/payment/store.rs b/src/payment/store.rs index 8ab3d12a2..b03b2f7a5 100644 --- a/src/payment/store.rs +++ b/src/payment/store.rs @@ -5,8 +5,6 @@ // http://opensource.org/licenses/MIT>, at your option. You may not use this file except in // accordance with one or both of these licenses. -use crate::types::TlvEntry; - use std::time::{Duration, SystemTime, UNIX_EPOCH}; use bitcoin::{BlockHash, Txid}; @@ -23,6 +21,7 @@ use lightning_types::string::UntrustedString; use crate::data_store::{StorableObject, StorableObjectId, StorableObjectUpdate}; use crate::hex_utils; +use crate::types::TlvEntry; /// Represents a payment. #[derive(Clone, Debug, PartialEq, Eq)] @@ -570,7 +569,7 @@ pub(crate) struct PaymentDetailsUpdate { pub counterparty_skimmed_fee_msat: Option>, pub direction: Option, pub status: Option, - //pub fee_msat: Option>, // old Alby field + // pub fee_msat: Option>, // old Alby field pub confirmation_status: Option, } diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 4dc0b110c..a93424330 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -100,7 +100,7 @@ macro_rules! expect_channel_ready_event { pub(crate) use expect_channel_ready_event; macro_rules! expect_splice_pending_event { - ($node: expr, $counterparty_node_id: expr) => {{ + ($node:expr, $counterparty_node_id:expr) => {{ match $node.next_event_async().await { ref e @ Event::SplicePending { new_funding_txo, counterparty_node_id, .. } => { println!("{} got event {:?}", $node.node_id(), e);