@@ -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 ,
@@ -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 ,
@@ -1695,7 +1698,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1695
1698
/// HTLC-Success/HTLC-Timeout transactions.
1696
1699
/// Return updates for HTLC pending in the channel and failed automatically by the broadcast of
1697
1700
/// revoked counterparty commitment tx
1698
- 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 {
1701
+ fn check_spend_counterparty_transaction < L : Deref > ( & mut self , tx : & Transaction , height : u32 , logger : & L ) -> ( Vec < ClaimRequest > , TransactionOutputs ) where L :: Target : Logger {
1699
1702
// Most secp and related errors trying to create keys means we have no hope of constructing
1700
1703
// a spend transaction...so we return no transactions to broadcast
1701
1704
let mut claimable_outpoints = Vec :: new ( ) ;
@@ -1906,7 +1909,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1906
1909
}
1907
1910
1908
1911
/// Attempts to claim a counterparty HTLC-Success/HTLC-Timeout's outputs using the revocation key
1909
- 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 {
1912
+ 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 {
1910
1913
let htlc_txid = tx. txid ( ) ;
1911
1914
if tx. input . len ( ) != 1 || tx. output . len ( ) != 1 || tx. input [ 0 ] . witness . len ( ) != 5 {
1912
1915
return ( Vec :: new ( ) , None )
@@ -1975,7 +1978,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1975
1978
/// Attempts to claim any claimable HTLCs in a commitment transaction which was not (yet)
1976
1979
/// revoked using data in holder_claimable_outpoints.
1977
1980
/// Should not be used if check_spend_revoked_transaction succeeds.
1978
- 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 {
1981
+ fn check_spend_holder_transaction < L : Deref > ( & mut self , tx : & Transaction , height : u32 , logger : & L ) -> ( Vec < ClaimRequest > , TransactionOutputs ) where L :: Target : Logger {
1979
1982
let commitment_txid = tx. txid ( ) ;
1980
1983
let mut claim_requests = Vec :: new ( ) ;
1981
1984
let mut watch_outputs = Vec :: new ( ) ;
@@ -2098,7 +2101,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2098
2101
return res
2099
2102
}
2100
2103
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 < ( Txid , Vec < ( u32 , TxOut ) > ) >
2104
+ 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 >
2102
2105
where B :: Target : BroadcasterInterface ,
2103
2106
F :: Target : FeeEstimator ,
2104
2107
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