@@ -1837,12 +1837,17 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
1837
1837
Vec :: new ( )
1838
1838
}
1839
1839
1840
- /// Called by SimpleManyChannelMonitor::block_connected, which implements
1841
- /// ChainListener::block_connected.
1842
- /// Eventually this should be pub and, roughly, implement ChainListener, however this requires
1843
- /// &mut self, as well as returns new spendable outputs and outpoints to watch for spending of
1844
- /// on-chain.
1845
- fn block_connected < B : Deref , F : Deref > ( & mut self , txn_matched : & [ & Transaction ] , height : u32 , block_hash : & BlockHash , broadcaster : B , fee_estimator : F ) -> Vec < ( Txid , Vec < TxOut > ) >
1840
+ /// Called when a new block has been connected to the best chain by <SimpleManyChannelMonitor
1841
+ /// as ChainListener>::block_connected, and should thus generally not be called during normal
1842
+ /// operation. It is exposed both for users who wish to use ChannelMonitors directly and to
1843
+ /// simplify rescans that occur at load-time.
1844
+ ///
1845
+ /// This is very similar to ChainListener::block_connected itself, but requires an &mut self,
1846
+ /// and an explicit reference to a transaction broadcaster and fee estimator.
1847
+ ///
1848
+ /// Returns a list of new (txid, outputs) pairs which spends of must be watched for. Note that
1849
+ /// after this call these are also available via get_outputs_to_watch().
1850
+ pub fn block_connected < B : Deref , F : Deref > ( & mut self , txn_matched : & [ & Transaction ] , height : u32 , block_hash : & BlockHash , broadcaster : B , fee_estimator : F ) -> Vec < ( Txid , Vec < TxOut > ) >
1846
1851
where B :: Target : BroadcasterInterface ,
1847
1852
F :: Target : FeeEstimator
1848
1853
{
@@ -1940,7 +1945,14 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
1940
1945
watch_outputs
1941
1946
}
1942
1947
1943
- fn block_disconnected < B : Deref , F : Deref > ( & mut self , height : u32 , block_hash : & BlockHash , broadcaster : B , fee_estimator : F )
1948
+ /// Called when a block has been disconnected from the best chain by <SimpleManyChannelMonitor
1949
+ /// as ChainListener>::block_disconnected, and should thus generally not be called during
1950
+ /// normal operation. It is exposed both for users who wish to use ChannelMonitors directly and
1951
+ /// to simplify rescans that occur at load-time.
1952
+ ///
1953
+ /// This is very similar to ChainListener::block_disconnected itself, but requires an &mut self,
1954
+ /// and an explicit reference to a transaction broadcaster and fee estimator.
1955
+ pub fn block_disconnected < B : Deref , F : Deref > ( & mut self , height : u32 , block_hash : & BlockHash , broadcaster : B , fee_estimator : F )
1944
1956
where B :: Target : BroadcasterInterface ,
1945
1957
F :: Target : FeeEstimator
1946
1958
{
0 commit comments