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