use util::events::EventHandler;
use prelude::*;
-use std::sync::RwLock;
+use sync::RwLock;
use core::ops::Deref;
/// An implementation of [`chain::Watch`] for monitoring channels.
use core::{cmp, mem};
use std::io::Error;
use core::ops::Deref;
-use std::sync::Mutex;
+use sync::Mutex;
/// An update generated by the underlying Channel itself which contains some new information the
/// ChannelMonitor should be made aware of.
use util::test_utils::{TestLogger, TestBroadcaster, TestFeeEstimator};
use bitcoin::secp256k1::key::{SecretKey,PublicKey};
use bitcoin::secp256k1::Secp256k1;
- use std::sync::{Arc, Mutex};
+ use sync::{Arc, Mutex};
use chain::keysinterface::InMemorySigner;
use prelude::*;
#[cfg(feature = "hashbrown")]
pub use self::hashbrown::{HashMap, HashSet, hash_map};
}
+
+mod sync {
+ pub use ::std::sync::{Arc, Mutex, Condvar, MutexGuard, RwLock, RwLockReadGuard};
+}
use util::test_utils;
use prelude::*;
-use std::sync::{Arc, Mutex};
+use sync::{Arc, Mutex};
// If persister_fail is true, we have the persister return a PermanentFailure
// instead of the higher-level ChainMonitor.
use core::{cmp,mem,fmt};
use core::ops::Deref;
#[cfg(any(test, feature = "fuzztarget"))]
-use std::sync::Mutex;
+use sync::Mutex;
+use sync;
use bitcoin::hashes::hex::ToHex;
use bitcoin::blockdata::opcodes::all::OP_PUSHBYTES_0;
#[cfg(debug_assertions)]
/// Max to_local and to_remote outputs in a locally-generated commitment transaction
- holder_max_commitment_tx_output: ::std::sync::Mutex<(u64, u64)>,
+ holder_max_commitment_tx_output: sync::Mutex<(u64, u64)>,
#[cfg(debug_assertions)]
/// Max to_local and to_remote outputs in a remote-generated commitment transaction
- counterparty_max_commitment_tx_output: ::std::sync::Mutex<(u64, u64)>,
+ counterparty_max_commitment_tx_output: sync::Mutex<(u64, u64)>,
last_sent_closing_fee: Option<(u32, u64, Signature)>, // (feerate, fee, holder_sig)
monitor_pending_failures: Vec::new(),
#[cfg(debug_assertions)]
- holder_max_commitment_tx_output: ::std::sync::Mutex::new((channel_value_satoshis * 1000 - push_msat, push_msat)),
+ holder_max_commitment_tx_output: sync::Mutex::new((channel_value_satoshis * 1000 - push_msat, push_msat)),
#[cfg(debug_assertions)]
- counterparty_max_commitment_tx_output: ::std::sync::Mutex::new((channel_value_satoshis * 1000 - push_msat, push_msat)),
+ counterparty_max_commitment_tx_output: sync::Mutex::new((channel_value_satoshis * 1000 - push_msat, push_msat)),
last_sent_closing_fee: None,
monitor_pending_failures: Vec::new(),
#[cfg(debug_assertions)]
- holder_max_commitment_tx_output: ::std::sync::Mutex::new((msg.push_msat, msg.funding_satoshis * 1000 - msg.push_msat)),
+ holder_max_commitment_tx_output: sync::Mutex::new((msg.push_msat, msg.funding_satoshis * 1000 - msg.push_msat)),
#[cfg(debug_assertions)]
- counterparty_max_commitment_tx_output: ::std::sync::Mutex::new((msg.push_msat, msg.funding_satoshis * 1000 - msg.push_msat)),
+ counterparty_max_commitment_tx_output: sync::Mutex::new((msg.push_msat, msg.funding_satoshis * 1000 - msg.push_msat)),
last_sent_closing_fee: None,
feerate_per_kw,
#[cfg(debug_assertions)]
- holder_max_commitment_tx_output: ::std::sync::Mutex::new((0, 0)),
+ holder_max_commitment_tx_output: sync::Mutex::new((0, 0)),
#[cfg(debug_assertions)]
- counterparty_max_commitment_tx_output: ::std::sync::Mutex::new((0, 0)),
+ counterparty_max_commitment_tx_output: sync::Mutex::new((0, 0)),
last_sent_closing_fee,
use bitcoin::hashes::sha256::Hash as Sha256;
use bitcoin::hashes::Hash;
use bitcoin::hash_types::{Txid, WPubkeyHash};
- use std::sync::Arc;
+ use sync::Arc;
use prelude::*;
struct TestFeeEstimator {
use core::{cmp, mem};
use core::cell::RefCell;
use std::io::{Cursor, Read};
-use std::sync::{Arc, Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard};
+use sync::{Arc, Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard};
use core::sync::atomic::{AtomicUsize, Ordering};
use core::time::Duration;
#[cfg(any(test, feature = "allow_wallclock_use"))]
#[cfg(test)]
mod tests {
use ln::channelmanager::PersistenceNotifier;
- use std::sync::Arc;
+ use sync::Arc;
use core::sync::atomic::{AtomicBool, Ordering};
use std::thread;
use core::time::Duration;
use bitcoin::hashes::sha256::Hash as Sha256;
use bitcoin::{Block, BlockHeader, Transaction, TxOut};
- use std::sync::{Arc, Mutex};
+ use sync::{Arc, Mutex};
use test::Bencher;
use prelude::*;
use core::cell::RefCell;
use std::rc::Rc;
-use std::sync::{Arc, Mutex};
+use sync::{Arc, Mutex};
use core::mem;
pub const CHAN_CONFIRM_DEPTH: u32 = 10;
use prelude::*;
use alloc::collections::BTreeSet;
use core::default::Default;
-use std::sync::{Arc, Mutex};
+use sync::{Arc, Mutex};
use ln::functional_test_utils::*;
use ln::chan_utils::CommitmentTransaction;
use prelude::*;
use alloc::collections::LinkedList;
use alloc::fmt::Debug;
-use std::sync::{Arc, Mutex};
+use sync::{Arc, Mutex};
use core::sync::atomic::{AtomicUsize, Ordering};
use core::{cmp, hash, fmt, mem};
use core::ops::Deref;
use bitcoin::secp256k1::key::{SecretKey, PublicKey};
use prelude::*;
- use std::sync::{Arc, Mutex};
+ use sync::{Arc, Mutex};
use core::sync::atomic::Ordering;
#[derive(Clone)]
use prelude::*;
use alloc::collections::{BTreeMap, btree_map::Entry as BtreeEntry};
use core::{cmp, fmt};
-use std::sync::{RwLock, RwLockReadGuard};
+use sync::{RwLock, RwLockReadGuard};
use core::sync::atomic::{AtomicUsize, Ordering};
-use std::sync::Mutex;
+use sync::Mutex;
use core::ops::Deref;
use bitcoin::hashes::hex::ToHex;
use bitcoin::secp256k1::{All, Secp256k1};
use prelude::*;
- use std::sync::Arc;
+ use sync::Arc;
fn create_net_graph_msg_handler() -> (Secp256k1<All>, NetGraphMsgHandler<Arc<test_utils::TestChainSource>, Arc<test_utils::TestLogger>>) {
let secp_ctx = Secp256k1::new();
use bitcoin::secp256k1::{Secp256k1, All};
use prelude::*;
- use std::sync::Arc;
+ use sync::{self, Arc};
fn get_channel_details(short_channel_id: Option<u64>, node_id: PublicKey,
features: InitFeatures, outbound_capacity_msat: u64) -> channelmanager::ChannelDetails {
}
}
- fn build_graph() -> (Secp256k1<All>, NetGraphMsgHandler<std::sync::Arc<test_utils::TestChainSource>, std::sync::Arc<crate::util::test_utils::TestLogger>>, std::sync::Arc<test_utils::TestChainSource>, std::sync::Arc<test_utils::TestLogger>) {
+ fn build_graph() -> (Secp256k1<All>, NetGraphMsgHandler<sync::Arc<test_utils::TestChainSource>, sync::Arc<crate::util::test_utils::TestLogger>>, sync::Arc<test_utils::TestChainSource>, sync::Arc<test_utils::TestLogger>) {
let secp_ctx = Secp256k1::new();
let logger = Arc::new(test_utils::TestLogger::new());
let chain_monitor = Arc::new(test_utils::TestChainSource::new(Network::Testnet));
use prelude::*;
use core::cmp;
-use std::sync::{Mutex, Arc};
+use sync::{Mutex, Arc};
use bitcoin::blockdata::transaction::{Transaction, SigHashType};
use bitcoin::util::bip143;
mod tests {
use util::logger::{Logger, Level};
use util::test_utils::TestLogger;
- use std::sync::Arc;
+ use sync::Arc;
#[test]
fn test_level_show() {
use prelude::*;
use std::io::{Read, Write};
use core::hash::Hash;
-use std::sync::Mutex;
+use sync::Mutex;
use core::cmp;
use bitcoin::secp256k1::Signature;
use prelude::*;
use core::time::Duration;
-use std::sync::{Mutex, Arc};
+use sync::{Mutex, Arc};
use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use core::{cmp, mem};
use chain::keysinterface::InMemorySigner;