Skip to content

Commit 4ae8b3a

Browse files
authored
Merge pull request #4134 from TheBlueMatt/2025-09-async-misc
Misc async API fixes
2 parents 54ed941 + 16e4ece commit 4ae8b3a

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

lightning/src/sign/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ pub trait ChangeDestinationSource {
10411041
///
10421042
/// This method should return a different value each time it is called, to avoid linking
10431043
/// on-chain funds controlled to the same user.
1044-
fn get_change_destination_script<'a>(&self) -> AsyncResult<'a, ScriptBuf>;
1044+
fn get_change_destination_script<'a>(&'a self) -> AsyncResult<'a, ScriptBuf>;
10451045
}
10461046

10471047
/// A synchronous helper trait that describes an on-chain wallet capable of returning a (change) destination script.
@@ -1073,7 +1073,7 @@ impl<T: Deref> ChangeDestinationSource for ChangeDestinationSourceSyncWrapper<T>
10731073
where
10741074
T::Target: ChangeDestinationSourceSync,
10751075
{
1076-
fn get_change_destination_script<'a>(&self) -> AsyncResult<'a, ScriptBuf> {
1076+
fn get_change_destination_script<'a>(&'a self) -> AsyncResult<'a, ScriptBuf> {
10771077
let script = self.0.get_change_destination_script();
10781078
Box::pin(async move { script })
10791079
}

lightning/src/util/async_poll.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,25 +92,29 @@ pub(crate) fn dummy_waker() -> Waker {
9292
unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &DUMMY_WAKER_VTABLE)) }
9393
}
9494

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

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

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

110-
// Marker trait to optionally implement `Send` under std.
112+
/// Marker trait to optionally implement `Send` under std.
111113
#[cfg(feature = "std")]
112114
pub use core::marker::Send as MaybeSend;
115+
113116
#[cfg(not(feature = "std"))]
117+
/// Marker trait to optionally implement `Send` under std.
114118
pub trait MaybeSend {}
115119
#[cfg(not(feature = "std"))]
116120
impl<T> MaybeSend for T where T: ?Sized {}

lightning/src/util/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub mod mut_global;
2020

2121
pub mod anchor_channel_reserves;
2222

23+
pub mod async_poll;
2324
#[cfg(fuzzing)]
2425
pub mod base32;
2526
#[cfg(not(fuzzing))]
@@ -33,7 +34,6 @@ pub mod ser;
3334
pub mod sweep;
3435
pub mod wakers;
3536

36-
pub(crate) mod async_poll;
3737
pub(crate) mod atomic_counter;
3838
pub(crate) mod byte_utils;
3939
pub mod hash_tables;

0 commit comments

Comments
 (0)