diff --git a/mutiny-core/Cargo.toml b/mutiny-core/Cargo.toml index c222ddad5..645a82d52 100644 --- a/mutiny-core/Cargo.toml +++ b/mutiny-core/Cargo.toml @@ -17,9 +17,9 @@ lnurl-rs = { version = "0.4.0", default-features = false, features = ["async", " cfg-if = "1.0.0" bip39 = { version = "2.0.0" } bitcoin = { version = "0.30.2", default-features = false, features = ["std", "serde", "secp-recovery", "rand"] } -bdk = { version = "1.0.0-alpha.5" } -bdk_esplora = { version = "0.7.0", default-features = false, features = ["std", "async-https"] } -bdk_chain = { version = "0.9.0", features = ["std"] } +bdk = { version = "=1.0.0-alpha.5" } +bdk_esplora = { version = "=0.7.0", default-features = false, features = ["std", "async-https"] } +bdk_chain = { version = "=0.9.0", features = ["std"] } bdk-macros = "0.6.0" getrandom = { version = "0.2" } itertools = "0.11.0" @@ -64,7 +64,7 @@ base64 = "0.13.0" pbkdf2 = "0.11" aes-gcm = "0.10.1" -log = "=0.4.18" +log = "0.4.18" futures = "0.3.25" thiserror = "1.0" anyhow = "1.0" diff --git a/mutiny-core/src/lib.rs b/mutiny-core/src/lib.rs index 52a209518..1a4b33bb8 100644 --- a/mutiny-core/src/lib.rs +++ b/mutiny-core/src/lib.rs @@ -46,6 +46,12 @@ mod test_utils; pub use crate::gossip::{GOSSIP_SYNC_TIME_KEY, NETWORK_GRAPH_KEY, PROB_SCORER_KEY}; pub use crate::keymanager::generate_seed; pub use crate::ldkstorage::{CHANNEL_CLOSURE_PREFIX, CHANNEL_MANAGER_KEY, MONITORS_PREFIX_KEY}; +pub use bitcoin; +pub use fedimint_core; +pub use lightning; +pub use lightning_invoice; +pub use nostr_sdk; + use crate::utils::spawn; use crate::{auth::MutinyAuthClient, hermes::HermesClient, logging::MutinyLogger}; use crate::{blindauth::BlindAuthClient, cashu::CashuHttpClient}; diff --git a/mutiny-core/src/nodemanager.rs b/mutiny-core/src/nodemanager.rs index 767c8a408..dd891a2ae 100644 --- a/mutiny-core/src/nodemanager.rs +++ b/mutiny-core/src/nodemanager.rs @@ -579,6 +579,12 @@ impl NodeManager { /// Creates a background process that will sync the wallet with the blockchain. /// This will also update the fee estimates every 10 minutes. pub fn start_sync(nm: Arc>) { + // sync every second on regtest, this makes testing easier + let sync_interval_secs = match nm.network { + Network::Bitcoin | Network::Testnet | Network::Signet => 60, + Network::Regtest => 1, + net => unreachable!("Unknown network: {net}"), + }; utils::spawn(async move { let mut synced = false; loop { @@ -617,8 +623,8 @@ impl NodeManager { synced = true; } - // sleep for 1 minute, checking graceful shutdown check each 1s. - for _ in 0..60 { + // wait for next sync round, checking graceful shutdown check each second. + for _ in 0..sync_interval_secs { if nm.stop.load(Ordering::Relaxed) { return; }