Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lightning/src/sign/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ pub trait ChangeDestinationSource {
///
/// This method should return a different value each time it is called, to avoid linking
/// on-chain funds controlled to the same user.
fn get_change_destination_script<'a>(&self) -> AsyncResult<'a, ScriptBuf>;
fn get_change_destination_script<'a>(&'a self) -> AsyncResult<'a, ScriptBuf>;
}

/// A synchronous helper trait that describes an on-chain wallet capable of returning a (change) destination script.
Expand Down Expand Up @@ -1073,7 +1073,7 @@ impl<T: Deref> ChangeDestinationSource for ChangeDestinationSourceSyncWrapper<T>
where
T::Target: ChangeDestinationSourceSync,
{
fn get_change_destination_script<'a>(&self) -> AsyncResult<'a, ScriptBuf> {
fn get_change_destination_script<'a>(&'a self) -> AsyncResult<'a, ScriptBuf> {
let script = self.0.get_change_destination_script();
Box::pin(async move { script })
}
Expand Down
10 changes: 7 additions & 3 deletions lightning/src/util/async_poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,29 @@ pub(crate) fn dummy_waker() -> Waker {
unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &DUMMY_WAKER_VTABLE)) }
}

/// A type alias for a future that returns a result of type T.
#[cfg(feature = "std")]
/// A type alias for a future that returns a result of type T.
pub type AsyncResult<'a, T> = Pin<Box<dyn Future<Output = Result<T, ()>> + 'a + Send>>;
#[cfg(not(feature = "std"))]
/// A type alias for a future that returns a result of type T.
pub type AsyncResult<'a, T> = Pin<Box<dyn Future<Output = Result<T, ()>> + 'a>>;

// Marker trait to optionally implement `Sync` under std.
/// Marker trait to optionally implement `Sync` under std.
#[cfg(feature = "std")]
pub use core::marker::Sync as MaybeSync;

#[cfg(not(feature = "std"))]
/// Marker trait to optionally implement `Sync` under std.
pub trait MaybeSync {}
#[cfg(not(feature = "std"))]
impl<T> MaybeSync for T where T: ?Sized {}

// Marker trait to optionally implement `Send` under std.
/// Marker trait to optionally implement `Send` under std.
#[cfg(feature = "std")]
pub use core::marker::Send as MaybeSend;

#[cfg(not(feature = "std"))]
/// Marker trait to optionally implement `Send` under std.
pub trait MaybeSend {}
#[cfg(not(feature = "std"))]
impl<T> MaybeSend for T where T: ?Sized {}
2 changes: 1 addition & 1 deletion lightning/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub mod mut_global;

pub mod anchor_channel_reserves;

pub mod async_poll;
#[cfg(fuzzing)]
pub mod base32;
#[cfg(not(fuzzing))]
Expand All @@ -33,7 +34,6 @@ pub mod ser;
pub mod sweep;
pub mod wakers;

pub(crate) mod async_poll;
pub(crate) mod atomic_counter;
pub(crate) mod byte_utils;
pub mod hash_tables;
Expand Down
Loading