@@ -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 ,
@@ -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