Skip to content

Commit 6bca01b

Browse files
fixup: Switch LSPSDateTime::is_past and related checks to use the 'time' feature instead of 'std'
1 parent 9e7f427 commit 6bca01b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lightning-liquidity/src/lsps0/ser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use lightning::util::ser::{LengthLimitedRead, LengthReadable, WithoutLength};
3131
use bitcoin::secp256k1::PublicKey;
3232

3333
use core::time::Duration;
34-
#[cfg(feature = "std")]
34+
#[cfg(feature = "time")]
3535
use std::time::{SystemTime, UNIX_EPOCH};
3636

3737
use serde::de::{self, MapAccess, Visitor};
@@ -206,7 +206,7 @@ impl LSPSDateTime {
206206
}
207207

208208
/// Returns if the given time is in the past.
209-
#[cfg(feature = "std")]
209+
#[cfg(feature = "time")]
210210
pub fn is_past(&self) -> bool {
211211
let now_seconds_since_epoch = SystemTime::now()
212212
.duration_since(UNIX_EPOCH)

lightning-liquidity/src/lsps2/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ pub fn is_valid_opening_fee_params(
2828
}
2929

3030
/// Determines if the given parameters are expired, or still valid.
31-
#[cfg_attr(not(feature = "std"), allow(unused_variables))]
31+
#[cfg_attr(not(feature = "time"), allow(unused_variables))]
3232
pub fn is_expired_opening_fee_params(fee_params: &LSPS2OpeningFeeParams) -> bool {
33-
#[cfg(feature = "std")]
33+
#[cfg(feature = "time")]
3434
{
3535
fee_params.valid_until.is_past()
3636
}
37-
#[cfg(not(feature = "std"))]
37+
#[cfg(not(feature = "time"))]
3838
{
3939
// TODO: We need to find a way to check expiry times in no-std builds.
4040
false

0 commit comments

Comments
 (0)