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