@@ -745,6 +745,9 @@ pub(crate) struct ChannelMonitorImpl<Signer: Sign> {
745
745
secp_ctx : Secp256k1 < secp256k1:: All > , //TODO: dedup this a bit...
746
746
}
747
747
748
+ /// Transaction outputs to watch for on-chain spends.
749
+ pub ( super ) type TransactionOutputs = ( Txid , Vec < ( u32 , TxOut ) > ) ;
750
+
748
751
#[ cfg( any( test, feature = "fuzztarget" , feature = "_test_utils" ) ) ]
749
752
/// Used only in testing and fuzztarget to check serialization roundtrips don't change the
750
753
/// underlying object
@@ -1276,7 +1279,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1276
1279
broadcaster : B ,
1277
1280
fee_estimator : F ,
1278
1281
logger : L ,
1279
- ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
1282
+ ) -> Vec < TransactionOutputs >
1280
1283
where
1281
1284
B :: Target : BroadcasterInterface ,
1282
1285
F :: Target : FeeEstimator ,
@@ -1321,7 +1324,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1321
1324
broadcaster : B ,
1322
1325
fee_estimator : F ,
1323
1326
logger : L ,
1324
- ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
1327
+ ) -> Vec < TransactionOutputs >
1325
1328
where
1326
1329
B :: Target : BroadcasterInterface ,
1327
1330
F :: Target : FeeEstimator ,
@@ -1376,7 +1379,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1376
1379
broadcaster : B ,
1377
1380
fee_estimator : F ,
1378
1381
logger : L ,
1379
- ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
1382
+ ) -> Vec < TransactionOutputs >
1380
1383
where
1381
1384
B :: Target : BroadcasterInterface ,
1382
1385
F :: Target : FeeEstimator ,
@@ -1691,7 +1694,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1691
1694
/// HTLC-Success/HTLC-Timeout transactions.
1692
1695
/// Return updates for HTLC pending in the channel and failed automatically by the broadcast of
1693
1696
/// revoked counterparty commitment tx
1694
- fn check_spend_counterparty_transaction < L : Deref > ( & mut self , tx : & Transaction , height : u32 , logger : & L ) -> ( Vec < ClaimRequest > , ( Txid , Vec < ( u32 , TxOut ) > ) ) where L :: Target : Logger {
1697
+ fn check_spend_counterparty_transaction < L : Deref > ( & mut self , tx : & Transaction , height : u32 , logger : & L ) -> ( Vec < ClaimRequest > , TransactionOutputs ) where L :: Target : Logger {
1695
1698
// Most secp and related errors trying to create keys means we have no hope of constructing
1696
1699
// a spend transaction...so we return no transactions to broadcast
1697
1700
let mut claimable_outpoints = Vec :: new ( ) ;
@@ -1902,7 +1905,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1902
1905
}
1903
1906
1904
1907
/// Attempts to claim a counterparty HTLC-Success/HTLC-Timeout's outputs using the revocation key
1905
- fn check_spend_counterparty_htlc < L : Deref > ( & mut self , tx : & Transaction , commitment_number : u64 , height : u32 , logger : & L ) -> ( Vec < ClaimRequest > , Option < ( Txid , Vec < ( u32 , TxOut ) > ) > ) where L :: Target : Logger {
1908
+ fn check_spend_counterparty_htlc < L : Deref > ( & mut self , tx : & Transaction , commitment_number : u64 , height : u32 , logger : & L ) -> ( Vec < ClaimRequest > , Option < TransactionOutputs > ) where L :: Target : Logger {
1906
1909
let htlc_txid = tx. txid ( ) ;
1907
1910
if tx. input . len ( ) != 1 || tx. output . len ( ) != 1 || tx. input [ 0 ] . witness . len ( ) != 5 {
1908
1911
return ( Vec :: new ( ) , None )
@@ -1971,7 +1974,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1971
1974
/// Attempts to claim any claimable HTLCs in a commitment transaction which was not (yet)
1972
1975
/// revoked using data in holder_claimable_outpoints.
1973
1976
/// Should not be used if check_spend_revoked_transaction succeeds.
1974
- fn check_spend_holder_transaction < L : Deref > ( & mut self , tx : & Transaction , height : u32 , logger : & L ) -> ( Vec < ClaimRequest > , ( Txid , Vec < ( u32 , TxOut ) > ) ) where L :: Target : Logger {
1977
+ fn check_spend_holder_transaction < L : Deref > ( & mut self , tx : & Transaction , height : u32 , logger : & L ) -> ( Vec < ClaimRequest > , TransactionOutputs ) where L :: Target : Logger {
1975
1978
let commitment_txid = tx. txid ( ) ;
1976
1979
let mut claim_requests = Vec :: new ( ) ;
1977
1980
let mut watch_outputs = Vec :: new ( ) ;
@@ -2094,7 +2097,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2094
2097
return res
2095
2098
}
2096
2099
2097
- pub fn block_connected < B : Deref , F : Deref , L : Deref > ( & mut self , header : & BlockHeader , txdata : & TransactionData , height : u32 , broadcaster : B , fee_estimator : F , logger : L ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
2100
+ pub fn block_connected < B : Deref , F : Deref , L : Deref > ( & mut self , header : & BlockHeader , txdata : & TransactionData , height : u32 , broadcaster : B , fee_estimator : F , logger : L ) -> Vec < TransactionOutputs >
2098
2101
where B :: Target : BroadcasterInterface ,
2099
2102
F :: Target : FeeEstimator ,
2100
2103
L :: Target : Logger ,
@@ -2113,7 +2116,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2113
2116
broadcaster : B ,
2114
2117
fee_estimator : F ,
2115
2118
logger : L ,
2116
- ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
2119
+ ) -> Vec < TransactionOutputs >
2117
2120
where
2118
2121
B :: Target : BroadcasterInterface ,
2119
2122
F :: Target : FeeEstimator ,
@@ -2141,7 +2144,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2141
2144
broadcaster : B ,
2142
2145
fee_estimator : F ,
2143
2146
logger : L ,
2144
- ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
2147
+ ) -> Vec < TransactionOutputs >
2145
2148
where
2146
2149
B :: Target : BroadcasterInterface ,
2147
2150
F :: Target : FeeEstimator ,
@@ -2209,12 +2212,12 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2209
2212
& mut self ,
2210
2213
height : u32 ,
2211
2214
txn_matched : Vec < & Transaction > ,
2212
- mut watch_outputs : Vec < ( Txid , Vec < ( u32 , TxOut ) > ) > ,
2215
+ mut watch_outputs : Vec < TransactionOutputs > ,
2213
2216
mut claimable_outpoints : Vec < ClaimRequest > ,
2214
2217
broadcaster : B ,
2215
2218
fee_estimator : F ,
2216
2219
logger : L ,
2217
- ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
2220
+ ) -> Vec < TransactionOutputs >
2218
2221
where
2219
2222
B :: Target : BroadcasterInterface ,
2220
2223
F :: Target : FeeEstimator ,
0 commit comments