Drop allow_wallclock_use feature in favor of simply using std

Fixes #1147.
This commit is contained in:
Matt Corallo 2021-12-10 05:57:30 +00:00
parent 11d644824e
commit c575429639
3 changed files with 8 additions and 10 deletions

View File

@ -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]

View File

@ -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.

View File

@ -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 {