@@ -1922,7 +1922,6 @@ impl<
19221922/// detailed in the [`ChannelManagerReadArgs`] documentation.
19231923///
19241924/// ```
1925- /// use bitcoin::BlockHash;
19261925/// use bitcoin::network::Network;
19271926/// use lightning::chain::BestBlock;
19281927/// # use lightning::chain::channelmonitor::ChannelMonitor;
@@ -1971,8 +1970,8 @@ impl<
19711970/// entropy_source, node_signer, signer_provider, fee_estimator, chain_monitor, tx_broadcaster,
19721971/// router, message_router, logger, config, channel_monitors.iter().collect(),
19731972/// );
1974- /// let (block_hash , channel_manager) =
1975- /// <(BlockHash , ChannelManager<_, _, _, _, _, _, _, _, _>)>::read(&mut reader, args)?;
1973+ /// let (best_block , channel_manager) =
1974+ /// <(BestBlock , ChannelManager<_, _, _, _, _, _, _, _, _>)>::read(&mut reader, args)?;
19761975///
19771976/// // Update the ChannelManager and ChannelMonitors with the latest chain data
19781977/// // ...
@@ -2539,7 +2538,7 @@ impl<
25392538/// [`read`], those channels will be force-closed based on the `ChannelMonitor` state and no funds
25402539/// will be lost (modulo on-chain transaction fees).
25412540///
2542- /// Note that the deserializer is only implemented for `(`[`BlockHash `]`, `[`ChannelManager`]`)`, which
2541+ /// Note that the deserializer is only implemented for `(`[`BestBlock `]`, `[`ChannelManager`]`)`, which
25432542/// tells you the last block hash which was connected. You should get the best block tip before using the manager.
25442543/// See [`chain::Listen`] and [`chain::Confirm`] for more details.
25452544///
@@ -2606,7 +2605,6 @@ impl<
26062605/// [`peer_disconnected`]: msgs::BaseMessageHandler::peer_disconnected
26072606/// [`funding_created`]: msgs::FundingCreated
26082607/// [`funding_transaction_generated`]: Self::funding_transaction_generated
2609- /// [`BlockHash`]: bitcoin::hash_types::BlockHash
26102608/// [`update_channel`]: chain::Watch::update_channel
26112609/// [`ChannelUpdate`]: msgs::ChannelUpdate
26122610/// [`read`]: ReadableArgs::read
@@ -17617,7 +17615,7 @@ impl<'a, ES: EntropySource, NS: NodeSigner, SP: SignerProvider, L: Logger>
1761717615/// is:
1761817616/// 1) Deserialize all stored [`ChannelMonitor`]s.
1761917617/// 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
17620- /// `<(BlockHash , ChannelManager)>::read(reader, args)`
17618+ /// `<(BestBlock , ChannelManager)>::read(reader, args)`
1762117619/// This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
1762217620/// [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
1762317621/// 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
@@ -17807,14 +17805,14 @@ impl<
1780717805 MR: MessageRouter,
1780817806 L: Logger + Clone,
1780917807 > ReadableArgs<ChannelManagerReadArgs<'a, M, T, ES, NS, SP, F, R, MR, L>>
17810- for (BlockHash , Arc<ChannelManager<M, T, ES, NS, SP, F, R, MR, L>>)
17808+ for (BestBlock , Arc<ChannelManager<M, T, ES, NS, SP, F, R, MR, L>>)
1781117809{
1781217810 fn read<Reader: io::Read>(
1781317811 reader: &mut Reader, args: ChannelManagerReadArgs<'a, M, T, ES, NS, SP, F, R, MR, L>,
1781417812 ) -> Result<Self, DecodeError> {
17815- let (blockhash , chan_manager) =
17816- <(BlockHash , ChannelManager<M, T, ES, NS, SP, F, R, MR, L>)>::read(reader, args)?;
17817- Ok((blockhash , Arc::new(chan_manager)))
17813+ let (best_block , chan_manager) =
17814+ <(BestBlock , ChannelManager<M, T, ES, NS, SP, F, R, MR, L>)>::read(reader, args)?;
17815+ Ok((best_block , Arc::new(chan_manager)))
1781817816 }
1781917817}
1782017818
@@ -17830,7 +17828,7 @@ impl<
1783017828 MR: MessageRouter,
1783117829 L: Logger + Clone,
1783217830 > ReadableArgs<ChannelManagerReadArgs<'a, M, T, ES, NS, SP, F, R, MR, L>>
17833- for (BlockHash , ChannelManager<M, T, ES, NS, SP, F, R, MR, L>)
17831+ for (BestBlock , ChannelManager<M, T, ES, NS, SP, F, R, MR, L>)
1783417832{
1783517833 fn read<Reader: io::Read>(
1783617834 reader: &mut Reader, args: ChannelManagerReadArgs<'a, M, T, ES, NS, SP, F, R, MR, L>,
@@ -17875,7 +17873,7 @@ impl<
1787517873 pub(super) fn from_channel_manager_data(
1787617874 data: ChannelManagerData<SP>,
1787717875 mut args: ChannelManagerReadArgs<'_, M, T, ES, NS, SP, F, R, MR, L>,
17878- ) -> Result<(BlockHash , Self), DecodeError> {
17876+ ) -> Result<(BestBlock , Self), DecodeError> {
1787917877 let ChannelManagerData {
1788017878 chain_hash,
1788117879 best_block_height,
@@ -19459,7 +19457,7 @@ impl<
1945919457 //TODO: Broadcast channel update for closed channels, but only after we've made a
1946019458 //connection or two.
1946119459
19462- Ok((best_block_hash , channel_manager))
19460+ Ok((best_block , channel_manager))
1946319461 }
1946419462}
1946519463
0 commit comments