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