@@ -1303,6 +1303,30 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1303
1303
self . inner . lock ( ) . unwrap ( ) . block_disconnected (
1304
1304
header, height, broadcaster, fee_estimator, logger)
1305
1305
}
1306
+
1307
+ /// Processes transactions from a block with the given header and height, returning new outputs
1308
+ /// to watch. See [`block_connected`] for details.
1309
+ ///
1310
+ /// TODO: Expand docs.
1311
+ ///
1312
+ /// [`block_connected`]: Self::block_connected
1313
+ pub fn transactions_confirmed < B : Deref , F : Deref , L : Deref > (
1314
+ & self ,
1315
+ header : & BlockHeader ,
1316
+ txdata : & TransactionData ,
1317
+ height : u32 ,
1318
+ broadcaster : B ,
1319
+ fee_estimator : F ,
1320
+ logger : L ,
1321
+ ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
1322
+ where
1323
+ B :: Target : BroadcasterInterface ,
1324
+ F :: Target : FeeEstimator ,
1325
+ L :: Target : Logger ,
1326
+ {
1327
+ self . inner . lock ( ) . unwrap ( ) . transactions_confirmed (
1328
+ header, txdata, height, broadcaster, fee_estimator, logger)
1329
+ }
1306
1330
}
1307
1331
1308
1332
impl < Signer : Sign > ChannelMonitorImpl < Signer > {
@@ -2003,6 +2027,24 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2003
2027
where B :: Target : BroadcasterInterface ,
2004
2028
F :: Target : FeeEstimator ,
2005
2029
L :: Target : Logger ,
2030
+ {
2031
+ self . best_block = BestBlock :: new ( header. block_hash ( ) , height) ;
2032
+ self . transactions_confirmed ( header, txdata, height, broadcaster, fee_estimator, logger)
2033
+ }
2034
+
2035
+ fn transactions_confirmed < B : Deref , F : Deref , L : Deref > (
2036
+ & mut self ,
2037
+ header : & BlockHeader ,
2038
+ txdata : & TransactionData ,
2039
+ height : u32 ,
2040
+ broadcaster : B ,
2041
+ fee_estimator : F ,
2042
+ logger : L ,
2043
+ ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
2044
+ where
2045
+ B :: Target : BroadcasterInterface ,
2046
+ F :: Target : FeeEstimator ,
2047
+ L :: Target : Logger ,
2006
2048
{
2007
2049
let txn_matched = self . filter_block ( txdata) ;
2008
2050
for tx in & txn_matched {
@@ -2135,7 +2177,6 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2135
2177
}
2136
2178
2137
2179
self . onchain_tx_handler . update_claims_view ( & txn_matched, claimable_outpoints, Some ( height) , & & * broadcaster, & & * fee_estimator, & & * logger) ;
2138
- self . best_block = BestBlock :: new ( block_hash, height) ;
2139
2180
2140
2181
// Determine new outputs to watch by comparing against previously known outputs to watch,
2141
2182
// updating the latter in the process.
0 commit comments