@@ -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
@@ -1277,7 +1280,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1277
1280
broadcaster : B ,
1278
1281
fee_estimator : F ,
1279
1282
logger : L ,
1280
- ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
1283
+ ) -> Vec < TransactionOutputs >
1281
1284
where
1282
1285
B :: Target : BroadcasterInterface ,
1283
1286
F :: Target : FeeEstimator ,
@@ -1319,7 +1322,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1319
1322
broadcaster : B ,
1320
1323
fee_estimator : F ,
1321
1324
logger : L ,
1322
- ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
1325
+ ) -> Vec < TransactionOutputs >
1323
1326
where
1324
1327
B :: Target : BroadcasterInterface ,
1325
1328
F :: Target : FeeEstimator ,
@@ -1355,7 +1358,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1355
1358
broadcaster : B ,
1356
1359
fee_estimator : F ,
1357
1360
logger : L ,
1358
- ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
1361
+ ) -> Vec < TransactionOutputs >
1359
1362
where
1360
1363
B :: Target : BroadcasterInterface ,
1361
1364
F :: Target : FeeEstimator ,
@@ -1670,7 +1673,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1670
1673
/// HTLC-Success/HTLC-Timeout transactions.
1671
1674
/// Return updates for HTLC pending in the channel and failed automatically by the broadcast of
1672
1675
/// revoked counterparty commitment tx
1673
- 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 {
1676
+ fn check_spend_counterparty_transaction < L : Deref > ( & mut self , tx : & Transaction , height : u32 , logger : & L ) -> ( Vec < ClaimRequest > , TransactionOutputs ) where L :: Target : Logger {
1674
1677
// Most secp and related errors trying to create keys means we have no hope of constructing
1675
1678
// a spend transaction...so we return no transactions to broadcast
1676
1679
let mut claimable_outpoints = Vec :: new ( ) ;
@@ -1881,7 +1884,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1881
1884
}
1882
1885
1883
1886
/// Attempts to claim a counterparty HTLC-Success/HTLC-Timeout's outputs using the revocation key
1884
- 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 {
1887
+ 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 {
1885
1888
let htlc_txid = tx. txid ( ) ;
1886
1889
if tx. input . len ( ) != 1 || tx. output . len ( ) != 1 || tx. input [ 0 ] . witness . len ( ) != 5 {
1887
1890
return ( Vec :: new ( ) , None )
@@ -1950,7 +1953,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1950
1953
/// Attempts to claim any claimable HTLCs in a commitment transaction which was not (yet)
1951
1954
/// revoked using data in holder_claimable_outpoints.
1952
1955
/// Should not be used if check_spend_revoked_transaction succeeds.
1953
- 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 {
1956
+ fn check_spend_holder_transaction < L : Deref > ( & mut self , tx : & Transaction , height : u32 , logger : & L ) -> ( Vec < ClaimRequest > , TransactionOutputs ) where L :: Target : Logger {
1954
1957
let commitment_txid = tx. txid ( ) ;
1955
1958
let mut claim_requests = Vec :: new ( ) ;
1956
1959
let mut watch_outputs = Vec :: new ( ) ;
@@ -2073,7 +2076,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2073
2076
return res
2074
2077
}
2075
2078
2076
- 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 ) > ) >
2079
+ 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 >
2077
2080
where B :: Target : BroadcasterInterface ,
2078
2081
F :: Target : FeeEstimator ,
2079
2082
L :: Target : Logger ,
@@ -2093,7 +2096,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2093
2096
broadcaster : B ,
2094
2097
fee_estimator : F ,
2095
2098
logger : L ,
2096
- ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
2099
+ ) -> Vec < TransactionOutputs >
2097
2100
where
2098
2101
B :: Target : BroadcasterInterface ,
2099
2102
F :: Target : FeeEstimator ,
@@ -2121,7 +2124,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2121
2124
broadcaster : B ,
2122
2125
fee_estimator : F ,
2123
2126
logger : L ,
2124
- ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
2127
+ ) -> Vec < TransactionOutputs >
2125
2128
where
2126
2129
B :: Target : BroadcasterInterface ,
2127
2130
F :: Target : FeeEstimator ,
@@ -2189,12 +2192,12 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2189
2192
& mut self ,
2190
2193
height : u32 ,
2191
2194
txn_matched : Vec < & Transaction > ,
2192
- mut watch_outputs : Vec < ( Txid , Vec < ( u32 , TxOut ) > ) > ,
2195
+ mut watch_outputs : Vec < TransactionOutputs > ,
2193
2196
mut claimable_outpoints : Vec < ClaimRequest > ,
2194
2197
broadcaster : B ,
2195
2198
fee_estimator : F ,
2196
2199
logger : L ,
2197
- ) -> Vec < ( Txid , Vec < ( u32 , TxOut ) > ) >
2200
+ ) -> Vec < TransactionOutputs >
2198
2201
where
2199
2202
B :: Target : BroadcasterInterface ,
2200
2203
F :: Target : FeeEstimator ,
0 commit comments