13
13
//! update [`ChannelMonitor`]s accordingly. If any on-chain events need further processing, it will
14
14
//! make those available as [`MonitorEvent`]s to be consumed.
15
15
//!
16
- //! `ChainMonitor` is parameterized by an optional chain source, which must implement the
16
+ //! [ `ChainMonitor`] is parameterized by an optional chain source, which must implement the
17
17
//! [`chain::Filter`] trait. This provides a mechanism to signal new relevant outputs back to light
18
18
//! clients, such that transactions spending those outputs are included in block data.
19
19
//!
20
- //! `ChainMonitor` may be used directly to monitor channels locally or as a part of a distributed
21
- //! setup to monitor channels remotely. In the latter case, a custom `chain::Watch` implementation
20
+ //! [ `ChainMonitor`] may be used directly to monitor channels locally or as a part of a distributed
21
+ //! setup to monitor channels remotely. In the latter case, a custom [ `chain::Watch`] implementation
22
22
//! would be responsible for routing each update to a remote server and for retrieving monitor
23
- //! events. The remote server would make use of `ChainMonitor` for block processing and for
24
- //! servicing `ChannelMonitor` updates from the client.
25
- //!
26
- //! [`ChainMonitor`]: struct.ChainMonitor.html
27
- //! [`chain::Filter`]: ../trait.Filter.html
28
- //! [`chain::Watch`]: ../trait.Watch.html
29
- //! [`ChannelMonitor`]: ../channelmonitor/struct.ChannelMonitor.html
30
- //! [`MonitorEvent`]: ../channelmonitor/enum.MonitorEvent.html
23
+ //! events. The remote server would make use of [`ChainMonitor`] for block processing and for
24
+ //! servicing [`ChannelMonitor`] updates from the client.
31
25
32
26
use bitcoin:: blockdata:: block:: { Block , BlockHeader } ;
33
27
@@ -53,9 +47,8 @@ use std::ops::Deref;
53
47
/// or used independently to monitor channels remotely. See the [module-level documentation] for
54
48
/// details.
55
49
///
56
- /// [`chain::Watch`]: ../trait.Watch.html
57
- /// [`ChannelManager`]: ../../ln/channelmanager/struct.ChannelManager.html
58
- /// [module-level documentation]: index.html
50
+ /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
51
+ /// [module-level documentation]: crate::chain::chainmonitor
59
52
pub struct ChainMonitor < ChannelSigner : Sign , C : Deref , T : Deref , F : Deref , L : Deref , P : Deref >
60
53
where C :: Target : chain:: Filter ,
61
54
T :: Target : BroadcasterInterface ,
@@ -88,10 +81,6 @@ where C::Target: chain::Filter,
88
81
/// calls must not exclude any transactions matching the new outputs nor any in-block
89
82
/// descendants of such transactions. It is not necessary to re-fetch the block to obtain
90
83
/// updated `txdata`.
91
- ///
92
- /// [`ChannelMonitor::block_connected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_connected
93
- /// [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
94
- /// [`chain::Filter`]: ../trait.Filter.html
95
84
pub fn block_connected ( & self , header : & BlockHeader , txdata : & TransactionData , height : u32 ) {
96
85
let monitors = self . monitors . read ( ) . unwrap ( ) ;
97
86
for monitor in monitors. values ( ) {
@@ -110,8 +99,6 @@ where C::Target: chain::Filter,
110
99
/// Dispatches to per-channel monitors, which are responsible for updating their on-chain view
111
100
/// of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
112
101
/// details.
113
- ///
114
- /// [`ChannelMonitor::block_disconnected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
115
102
pub fn block_disconnected ( & self , header : & BlockHeader , disconnected_height : u32 ) {
116
103
let monitors = self . monitors . read ( ) . unwrap ( ) ;
117
104
for monitor in monitors. values ( ) {
@@ -126,8 +113,6 @@ where C::Target: chain::Filter,
126
113
/// pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
127
114
/// always need to fetch full blocks absent another means for determining which blocks contain
128
115
/// transactions relevant to the watched channels.
129
- ///
130
- /// [`chain::Filter`]: ../trait.Filter.html
131
116
pub fn new ( chain_source : Option < C > , broadcaster : T , logger : L , feeest : F , persister : P ) -> Self {
132
117
Self {
133
118
monitors : RwLock :: new ( HashMap :: new ( ) ) ,
@@ -174,8 +159,6 @@ where C::Target: chain::Filter,
174
159
///
175
160
/// Note that we persist the given `ChannelMonitor` while holding the `ChainMonitor`
176
161
/// monitors lock.
177
- ///
178
- /// [`chain::Filter`]: ../trait.Filter.html
179
162
fn watch_channel ( & self , funding_outpoint : OutPoint , monitor : ChannelMonitor < ChannelSigner > ) -> Result < ( ) , ChannelMonitorUpdateErr > {
180
163
let mut monitors = self . monitors . write ( ) . unwrap ( ) ;
181
164
let entry = match monitors. entry ( funding_outpoint) {
0 commit comments