Skip to content

Commit c575429

Browse files
committed
Drop allow_wallclock_use feature in favor of simply using std
Fixes #1147.
1 parent 11d6448 commit c575429

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

lightning-background-processor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ edition = "2018"
1111

1212
[dependencies]
1313
bitcoin = "0.27"
14-
lightning = { version = "0.0.103", path = "../lightning", features = ["allow_wallclock_use"] }
14+
lightning = { version = "0.0.103", path = "../lightning", features = ["std"] }
1515
lightning-persister = { version = "0.0.103", path = "../lightning-persister" }
1616

1717
[dev-dependencies]

lightning/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Still missing tons of error-handling. See GitHub issues for suggested projects i
1111
"""
1212

1313
[features]
14-
allow_wallclock_use = []
1514
fuzztarget = ["bitcoin/fuzztarget", "regex"]
1615
# Internal test utilities exposed to other repo crates
1716
_test_utils = ["hex", "regex", "bitcoin/bitcoinconsensus"]
@@ -53,6 +52,3 @@ secp256k1 = { version = "0.20.2", default-features = false, features = ["alloc"]
5352
version = "0.27"
5453
default-features = false
5554
features = ["bitcoinconsensus", "secp-recovery"]
56-
57-
[package.metadata.docs.rs]
58-
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.

lightning/src/ln/channelmanager.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ use io::{Cursor, Read};
6767
use sync::{Arc, Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard};
6868
use core::sync::atomic::{AtomicUsize, Ordering};
6969
use core::time::Duration;
70-
#[cfg(any(test, feature = "allow_wallclock_use"))]
71-
use std::time::Instant;
7270
use core::ops::Deref;
7371

72+
#[cfg(any(test, feature = "std"))]
73+
use std::time::Instant;
74+
7475
// We hold various information about HTLC relay in the HTLC objects in Channel itself:
7576
//
7677
// Upon receipt of an HTLC from a peer, we'll give it a PendingHTLCStatus indicating if it should
@@ -5110,8 +5111,9 @@ where
51105111
/// indicating whether persistence is necessary. Only one listener on
51115112
/// `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
51125113
/// up.
5113-
/// Note that the feature `allow_wallclock_use` must be enabled to use this function.
5114-
#[cfg(any(test, feature = "allow_wallclock_use"))]
5114+
///
5115+
/// Note that this method is not available with the `no-std` feature.
5116+
#[cfg(any(test, feature = "std"))]
51155117
pub fn await_persistable_update_timeout(&self, max_wait: Duration) -> bool {
51165118
self.persistence_notifier.wait_timeout(max_wait)
51175119
}
@@ -5406,7 +5408,7 @@ impl PersistenceNotifier {
54065408
}
54075409
}
54085410

5409-
#[cfg(any(test, feature = "allow_wallclock_use"))]
5411+
#[cfg(any(test, feature = "std"))]
54105412
fn wait_timeout(&self, max_wait: Duration) -> bool {
54115413
let current_time = Instant::now();
54125414
loop {

0 commit comments

Comments
 (0)