Skip to content

Commit e7c158c

Browse files
committed
f - Wait on async offer readiness future
Use the lower-level readiness future before fetching the async offer. This keeps LSPS2 JIT receive compatible with the LDK API cleanup. Co-Authored-By: HAL 9000
1 parent 12f2811 commit e7c158c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/payment/bolt12.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,17 +436,17 @@ impl Bolt12Payment {
436436
payment_metadata.encode_as_bolt12_payment_metadata(),
437437
)
438438
.or(Err(Error::OfferCreationFailed))?;
439-
let offer = self
440-
.runtime
439+
self.runtime
441440
.block_on(async {
442441
tokio::time::timeout(
443442
Duration::from_secs(10),
444-
self.channel_manager.await_async_receive_offer(),
443+
self.channel_manager.get_async_receive_offer_ready_future(),
445444
)
446445
.await
447446
})
448-
.map_err(|_| Error::OfferCreationFailed)?
449-
.or(Err(Error::OfferCreationFailed))?;
447+
.map_err(|_| Error::OfferCreationFailed)?;
448+
let offer =
449+
self.channel_manager.get_async_receive_offer().or(Err(Error::OfferCreationFailed))?;
450450

451451
log_info!(
452452
self.logger,

0 commit comments

Comments
 (0)