mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-01-18 21:34:48 +01:00
Drop allow_wallclock_use
feature in favor of simply using std
Fixes #1147.
This commit is contained in:
parent
11d644824e
commit
c575429639
@ -11,7 +11,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
bitcoin = "0.27"
|
||||
lightning = { version = "0.0.103", path = "../lightning", features = ["allow_wallclock_use"] }
|
||||
lightning = { version = "0.0.103", path = "../lightning", features = ["std"] }
|
||||
lightning-persister = { version = "0.0.103", path = "../lightning-persister" }
|
||||
|
||||
[dev-dependencies]
|
||||
|
@ -11,7 +11,6 @@ Still missing tons of error-handling. See GitHub issues for suggested projects i
|
||||
"""
|
||||
|
||||
[features]
|
||||
allow_wallclock_use = []
|
||||
fuzztarget = ["bitcoin/fuzztarget", "regex"]
|
||||
# Internal test utilities exposed to other repo crates
|
||||
_test_utils = ["hex", "regex", "bitcoin/bitcoinconsensus"]
|
||||
@ -53,6 +52,3 @@ secp256k1 = { version = "0.20.2", default-features = false, features = ["alloc"]
|
||||
version = "0.27"
|
||||
default-features = false
|
||||
features = ["bitcoinconsensus", "secp-recovery"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = ["allow_wallclock_use"] # When https://github.com/rust-lang/rust/issues/43781 complies with our MSVR, we can add nice banners in the docs for the methods behind this feature-gate.
|
||||
|
@ -67,10 +67,11 @@ use io::{Cursor, Read};
|
||||
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"))]
|
||||
use std::time::Instant;
|
||||
use core::ops::Deref;
|
||||
|
||||
#[cfg(any(test, feature = "std"))]
|
||||
use std::time::Instant;
|
||||
|
||||
// We hold various information about HTLC relay in the HTLC objects in Channel itself:
|
||||
//
|
||||
// Upon receipt of an HTLC from a peer, we'll give it a PendingHTLCStatus indicating if it should
|
||||
@ -5110,8 +5111,9 @@ where
|
||||
/// indicating whether persistence is necessary. Only one listener on
|
||||
/// `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
|
||||
/// up.
|
||||
/// Note that the feature `allow_wallclock_use` must be enabled to use this function.
|
||||
#[cfg(any(test, feature = "allow_wallclock_use"))]
|
||||
///
|
||||
/// Note that this method is not available with the `no-std` feature.
|
||||
#[cfg(any(test, feature = "std"))]
|
||||
pub fn await_persistable_update_timeout(&self, max_wait: Duration) -> bool {
|
||||
self.persistence_notifier.wait_timeout(max_wait)
|
||||
}
|
||||
@ -5406,7 +5408,7 @@ impl PersistenceNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(test, feature = "allow_wallclock_use"))]
|
||||
#[cfg(any(test, feature = "std"))]
|
||||
fn wait_timeout(&self, max_wait: Duration) -> bool {
|
||||
let current_time = Instant::now();
|
||||
loop {
|
||||
|
Loading…
Reference in New Issue
Block a user