Skip to content

Commit 8d0690a

Browse files
committed
f! doc
1 parent 667f234 commit 8d0690a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lightning-invoice/src/payment.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,23 @@
4040
//! # use lightning::routing::gossip::NodeId;
4141
//! # use lightning::routing::router::{Route, RouteHop, RouteParameters};
4242
//! # use lightning::routing::scoring::{ChannelUsage, Score};
43-
//! # use lightning::util::events::{Event, EventHandler, EventsProvider};
43+
//! # use lightning::util::events::{Event, AsyncEventHandler, EventHandler, EventsProvider};
4444
//! # use lightning::util::logger::{Logger, Record};
4545
//! # use lightning::util::ser::{Writeable, Writer};
4646
//! # use lightning_invoice::Invoice;
4747
//! # use lightning_invoice::payment::{InFlightHtlcs, InvoicePayer, Payer, Retry, Router};
4848
//! # use secp256k1::PublicKey;
4949
//! # use std::cell::RefCell;
50+
//! # use std::future::Future;
5051
//! # use std::ops::Deref;
52+
//! # use std::pin::Pin;
5153
//! #
5254
//! # struct FakeEventProvider {}
5355
//! # impl EventsProvider for FakeEventProvider {
5456
//! # fn process_pending_events<H: Deref>(&self, handler: H) where H::Target: EventHandler {}
5557
//! # fn process_pending_events_async<'a, H: Deref + 'a>(
5658
//! # &'a self, handler: H
57-
//! # ) -> Pin<Box<dyn StdFuture<Output = ()> + 'a>> where H::Target: AsyncEventHandler {}
59+
//! # ) -> Pin<Box<dyn Future<Output = ()> + 'a>> where H::Target: AsyncEventHandler {}
5860
//! # }
5961
//! #
6062
//! # struct FakePayer {}

lightning/src/ln/channelmanager.rs

+3
Original file line numberDiff line numberDiff line change
@@ -5654,7 +5654,10 @@ where
56545654
// We can't use `optionally_notify` with an async closure as required by the
56555655
// `handle_event_async` call since it's not supported on stable.
56565656
Box::pin(async move {
5657+
// We'll acquire our total consistency lock until the returned future completes so that
5658+
// we can be sure no other persists happen while processing events.
56575659
let _read_guard = self.total_consistency_lock.read().unwrap();
5660+
56585661
let mut result = NotifyOption::SkipPersist;
56595662

56605663
// TODO: This behavior should be documented. It's unintuitive that we query

0 commit comments

Comments
 (0)