@@ -64,14 +64,29 @@ pub struct ChannelMonitorUpdate {
64
64
pub ( crate ) updates : Vec < ChannelMonitorUpdateStep > ,
65
65
/// The sequence number of this update. Updates *must* be replayed in-order according to this
66
66
/// sequence number (and updates may panic if they are not). The update_id values are strictly
67
- /// increasing and increase by one for each new update.
67
+ /// increasing and increase by one for each new update, with one exception specified below .
68
68
///
69
69
/// This sequence number is also used to track up to which points updates which returned
70
70
/// ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
71
71
/// ChannelMonitor when ChannelManager::channel_monitor_updated is called.
72
+ ///
73
+ /// The only instance where update_id values are not strictly increasing is the case where we
74
+ /// allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
75
+ /// its docs for more details.
76
+ ///
77
+ /// [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
72
78
pub update_id : u64 ,
73
79
}
74
80
81
+ /// If:
82
+ /// (1) a channel has been force closed and
83
+ /// (2) we receive a preimage from a forward link that allows us to spend an HTLC output on
84
+ /// this channel's (the backward link's) broadcasted commitment transaction
85
+ /// then we allow the `ChannelManager` to send a `ChannelMonitorUpdate` with this update ID,
86
+ /// with the update providing said payment preimage. No other update types are allowed after
87
+ /// force-close.
88
+ pub const CLOSED_CHANNEL_UPDATE_ID : u64 = std:: u64:: MAX ;
89
+
75
90
impl Writeable for ChannelMonitorUpdate {
76
91
fn write < W : Writer > ( & self , w : & mut W ) -> Result < ( ) , :: std:: io:: Error > {
77
92
self . update_id . write ( w) ?;
@@ -1144,8 +1159,47 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
1144
1159
1145
1160
/// Provides a payment_hash->payment_preimage mapping. Will be automatically pruned when all
1146
1161
/// commitment_tx_infos which contain the payment hash have been revoked.
1147
- pub ( crate ) fn provide_payment_preimage ( & mut self , payment_hash : & PaymentHash , payment_preimage : & PaymentPreimage ) {
1162
+ pub ( crate ) fn provide_payment_preimage < B : Deref , F : Deref , L : Deref > ( & mut self , payment_hash : & PaymentHash , payment_preimage : & PaymentPreimage , broadcaster : & B , fee_estimator : & F , logger : & L )
1163
+ where B :: Target : BroadcasterInterface ,
1164
+ F :: Target : FeeEstimator ,
1165
+ L :: Target : Logger ,
1166
+ {
1148
1167
self . payment_preimages . insert ( payment_hash. clone ( ) , payment_preimage. clone ( ) ) ;
1168
+
1169
+ // If the channel is force closed, try to claim the output from this preimage.
1170
+ // First check if a counterparty commitment transaction has been broadcasted:
1171
+ macro_rules! claim_htlcs {
1172
+ ( $commitment_number: expr, $txid: expr) => {
1173
+ let htlc_claim_reqs = self . get_counterparty_htlc_output_claim_reqs( $commitment_number, $txid, None ) ;
1174
+ self . onchain_tx_handler. update_claims_view( & Vec :: new( ) , htlc_claim_reqs, None , broadcaster, fee_estimator, logger) ;
1175
+ }
1176
+ }
1177
+ if let Some ( txid) = self . current_counterparty_commitment_txid {
1178
+ if let Some ( commitment_number) = self . counterparty_commitment_txn_on_chain . get ( & txid) {
1179
+ claim_htlcs ! ( * commitment_number, txid) ;
1180
+ return ;
1181
+ }
1182
+ }
1183
+ if let Some ( txid) = self . prev_counterparty_commitment_txid {
1184
+ if let Some ( commitment_number) = self . counterparty_commitment_txn_on_chain . get ( & txid) {
1185
+ claim_htlcs ! ( * commitment_number, txid) ;
1186
+ return ;
1187
+ }
1188
+ }
1189
+
1190
+ // Then if a holder commitment transaction has been seen on-chain, broadcast transactions
1191
+ // claiming the HTLC output from each of the holder commitment transactions.
1192
+ // Note that we can't just use `self.holder_tx_signed`, because that only covers the case where
1193
+ // *we* sign a holder commitment transaction, not when e.g. a watchtower broadcasts one of our
1194
+ // holder commitment transactions.
1195
+ if self . broadcasted_holder_revokable_script . is_some ( ) {
1196
+ let ( claim_reqs, _) = self . get_broadcasted_holder_claims ( & self . current_holder_commitment_tx ) ;
1197
+ self . onchain_tx_handler . update_claims_view ( & Vec :: new ( ) , claim_reqs, None , broadcaster, fee_estimator, logger) ;
1198
+ if let Some ( ref tx) = self . prev_holder_signed_commitment_tx {
1199
+ let ( claim_reqs, _) = self . get_broadcasted_holder_claims ( & tx) ;
1200
+ self . onchain_tx_handler . update_claims_view ( & Vec :: new ( ) , claim_reqs, None , broadcaster, fee_estimator, logger) ;
1201
+ }
1202
+ }
1149
1203
}
1150
1204
1151
1205
pub ( crate ) fn broadcast_latest_holder_commitment_txn < B : Deref , L : Deref > ( & mut self , broadcaster : & B , logger : & L )
@@ -1162,26 +1216,45 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
1162
1216
/// itself.
1163
1217
///
1164
1218
/// panics if the given update is not the next update by update_id.
1165
- pub fn update_monitor < B : Deref , L : Deref > ( & mut self , updates : & ChannelMonitorUpdate , broadcaster : & B , logger : & L ) -> Result < ( ) , MonitorUpdateError >
1166
- where B :: Target : BroadcasterInterface ,
1167
- L :: Target : Logger ,
1219
+ pub fn update_monitor < B : Deref , F : Deref , L : Deref > ( & mut self , updates : & ChannelMonitorUpdate , broadcaster : & B , fee_estimator : & F , logger : & L ) -> Result < ( ) , MonitorUpdateError >
1220
+ where B :: Target : BroadcasterInterface ,
1221
+ F :: Target : FeeEstimator ,
1222
+ L :: Target : Logger ,
1168
1223
{
1169
- if self . latest_update_id + 1 != updates. update_id {
1224
+ // ChannelMonitor updates may be applied after force close if we receive a
1225
+ // preimage for a broadcasted commitment transaction HTLC output that we'd
1226
+ // like to claim on-chain. If this is the case, we no longer have guaranteed
1227
+ // access to the monitor's update ID, so we use a sentinel value instead.
1228
+ if updates. update_id == CLOSED_CHANNEL_UPDATE_ID {
1229
+ match updates. updates [ 0 ] {
1230
+ ChannelMonitorUpdateStep :: PaymentPreimage { .. } => { } ,
1231
+ _ => panic ! ( "Attempted to apply post-force-close ChannelMonitorUpdate that wasn't providing a payment preimage" ) ,
1232
+ }
1233
+ assert_eq ! ( updates. updates. len( ) , 1 ) ;
1234
+ } else if self . latest_update_id + 1 != updates. update_id {
1170
1235
panic ! ( "Attempted to apply ChannelMonitorUpdates out of order, check the update_id before passing an update to update_monitor!" ) ;
1171
1236
}
1172
1237
for update in updates. updates . iter ( ) {
1173
1238
match update {
1174
1239
ChannelMonitorUpdateStep :: LatestHolderCommitmentTXInfo { commitment_tx, htlc_outputs } => {
1240
+ log_trace ! ( logger, "Updating ChannelMonitor with latest holder commitment transaction info" ) ;
1175
1241
if self . lockdown_from_offchain { panic ! ( ) ; }
1176
1242
self . provide_latest_holder_commitment_tx_info ( commitment_tx. clone ( ) , htlc_outputs. clone ( ) ) ?
1177
1243
} ,
1178
- ChannelMonitorUpdateStep :: LatestCounterpartyCommitmentTXInfo { unsigned_commitment_tx, htlc_outputs, commitment_number, their_revocation_point } =>
1179
- self . provide_latest_counterparty_commitment_tx_info ( & unsigned_commitment_tx, htlc_outputs. clone ( ) , * commitment_number, * their_revocation_point, logger) ,
1180
- ChannelMonitorUpdateStep :: PaymentPreimage { payment_preimage } =>
1181
- self . provide_payment_preimage ( & PaymentHash ( Sha256 :: hash ( & payment_preimage. 0 [ ..] ) . into_inner ( ) ) , & payment_preimage) ,
1182
- ChannelMonitorUpdateStep :: CommitmentSecret { idx, secret } =>
1183
- self . provide_secret ( * idx, * secret) ?,
1244
+ ChannelMonitorUpdateStep :: LatestCounterpartyCommitmentTXInfo { unsigned_commitment_tx, htlc_outputs, commitment_number, their_revocation_point } => {
1245
+ log_trace ! ( logger, "Updating ChannelMonitor with latest counterparty commitment transaction info" ) ;
1246
+ self . provide_latest_counterparty_commitment_tx_info ( & unsigned_commitment_tx, htlc_outputs. clone ( ) , * commitment_number, * their_revocation_point, logger)
1247
+ } ,
1248
+ ChannelMonitorUpdateStep :: PaymentPreimage { payment_preimage } => {
1249
+ log_trace ! ( logger, "Updating ChannelMonitor with payment preimage" ) ;
1250
+ self . provide_payment_preimage ( & PaymentHash ( Sha256 :: hash ( & payment_preimage. 0 [ ..] ) . into_inner ( ) ) , & payment_preimage, broadcaster, fee_estimator, logger)
1251
+ } ,
1252
+ ChannelMonitorUpdateStep :: CommitmentSecret { idx, secret } => {
1253
+ log_trace ! ( logger, "Updating ChannelMonitor with commitment secret" ) ;
1254
+ self . provide_secret ( * idx, * secret) ?
1255
+ } ,
1184
1256
ChannelMonitorUpdateStep :: ChannelForceClosed { should_broadcast } => {
1257
+ log_trace ! ( logger, "Updating ChannelMonitor: channel force closed, should broadcast: {}" , should_broadcast) ;
1185
1258
self . lockdown_from_offchain = true ;
1186
1259
if * should_broadcast {
1187
1260
self . broadcast_latest_holder_commitment_txn ( broadcaster, logger) ;
@@ -1425,39 +1498,55 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
1425
1498
check_htlc_fails ! ( txid, "previous" , ' prev_loop) ;
1426
1499
}
1427
1500
1501
+ let htlc_claim_reqs = self . get_counterparty_htlc_output_claim_reqs ( commitment_number, commitment_txid, Some ( tx) ) ;
1502
+ for req in htlc_claim_reqs {
1503
+ claimable_outpoints. push ( req) ;
1504
+ }
1505
+
1506
+ }
1507
+ ( claimable_outpoints, ( commitment_txid, watch_outputs) )
1508
+ }
1509
+
1510
+ fn get_counterparty_htlc_output_claim_reqs ( & self , commitment_number : u64 , commitment_txid : Txid , tx : Option < & Transaction > ) -> Vec < ClaimRequest > {
1511
+ let mut claims = Vec :: new ( ) ;
1512
+ if let Some ( htlc_outputs) = self . counterparty_claimable_outpoints . get ( & commitment_txid) {
1428
1513
if let Some ( revocation_points) = self . their_cur_revocation_points {
1429
1514
let revocation_point_option =
1515
+ // If the counterparty commitment tx is the latest valid state, use their latest
1516
+ // per-commitment point
1430
1517
if revocation_points. 0 == commitment_number { Some ( & revocation_points. 1 ) }
1431
1518
else if let Some ( point) = revocation_points. 2 . as_ref ( ) {
1519
+ // If counterparty commitment tx is the state previous to the latest valid state, use
1520
+ // their previous per-commitment point (non-atomicity of revocation means it's valid for
1521
+ // them to temporarily have two valid commitment txns from our viewpoint)
1432
1522
if revocation_points. 0 == commitment_number + 1 { Some ( point) } else { None }
1433
1523
} else { None } ;
1434
1524
if let Some ( revocation_point) = revocation_point_option {
1435
- self . counterparty_payment_script = {
1436
- // Note that the Network here is ignored as we immediately drop the address for the
1437
- // script_pubkey version
1438
- let payment_hash160 = WPubkeyHash :: hash ( & self . keys . pubkeys ( ) . payment_point . serialize ( ) ) ;
1439
- Builder :: new ( ) . push_opcode ( opcodes:: all:: OP_PUSHBYTES_0 ) . push_slice ( & payment_hash160[ ..] ) . into_script ( )
1440
- } ;
1441
-
1442
- // Then, try to find htlc outputs
1443
- for ( _, & ( ref htlc, _) ) in per_commitment_data. iter ( ) . enumerate ( ) {
1525
+ for ( _, & ( ref htlc, _) ) in htlc_outputs. iter ( ) . enumerate ( ) {
1444
1526
if let Some ( transaction_output_index) = htlc. transaction_output_index {
1445
- if transaction_output_index as usize >= tx. output . len ( ) ||
1446
- tx. output [ transaction_output_index as usize ] . value != htlc. amount_msat / 1000 {
1447
- return ( claimable_outpoints, ( commitment_txid, watch_outputs) ) ; // Corrupted per_commitment_data, fuck this user
1527
+ if let Some ( transaction) = tx {
1528
+ if transaction_output_index as usize >= transaction. output . len ( ) ||
1529
+ transaction. output [ transaction_output_index as usize ] . value != htlc. amount_msat / 1000 {
1530
+ return claims; // Corrupted per_commitment_data, fuck this user
1531
+ }
1448
1532
}
1449
- let preimage = if htlc. offered { if let Some ( p) = self . payment_preimages . get ( & htlc. payment_hash ) { Some ( * p) } else { None } } else { None } ;
1533
+ let preimage =
1534
+ if htlc. offered {
1535
+ if let Some ( p) = self . payment_preimages . get ( & htlc. payment_hash ) {
1536
+ Some ( * p)
1537
+ } else { None }
1538
+ } else { None } ;
1450
1539
let aggregable = if !htlc. offered { false } else { true } ;
1451
1540
if preimage. is_some ( ) || !htlc. offered {
1452
1541
let witness_data = InputMaterial :: CounterpartyHTLC { per_commitment_point : * revocation_point, counterparty_delayed_payment_base_key : self . counterparty_tx_cache . counterparty_delayed_payment_base_key , counterparty_htlc_base_key : self . counterparty_tx_cache . counterparty_htlc_base_key , preimage, htlc : htlc. clone ( ) } ;
1453
- claimable_outpoints . push ( ClaimRequest { absolute_timelock : htlc. cltv_expiry , aggregable, outpoint : BitcoinOutPoint { txid : commitment_txid, vout : transaction_output_index } , witness_data } ) ;
1542
+ claims . push ( ClaimRequest { absolute_timelock : htlc. cltv_expiry , aggregable, outpoint : BitcoinOutPoint { txid : commitment_txid, vout : transaction_output_index } , witness_data } ) ;
1454
1543
}
1455
1544
}
1456
1545
}
1457
1546
}
1458
1547
}
1459
1548
}
1460
- ( claimable_outpoints , ( commitment_txid , watch_outputs ) )
1549
+ claims
1461
1550
}
1462
1551
1463
1552
/// Attempts to claim a counterparty HTLC-Success/HTLC-Timeout's outputs using the revocation key
@@ -1487,9 +1576,11 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
1487
1576
( claimable_outpoints, Some ( ( htlc_txid, outputs) ) )
1488
1577
}
1489
1578
1490
- fn broadcast_by_holder_state ( & self , commitment_tx : & Transaction , holder_tx : & HolderSignedTx ) -> ( Vec < ClaimRequest > , Vec < ( u32 , TxOut ) > , Option < ( Script , PublicKey , PublicKey ) > ) {
1579
+ // Returns (1) `ClaimRequest`s that can be given to the OnChainTxHandler, so that the handler can
1580
+ // broadcast transactions claiming holder HTLC commitment outputs and (2) a holder revokable
1581
+ // script so we can detect whether a holder transaction has been seen on-chain.
1582
+ fn get_broadcasted_holder_claims ( & self , holder_tx : & HolderSignedTx ) -> ( Vec < ClaimRequest > , Option < ( Script , PublicKey , PublicKey ) > ) {
1491
1583
let mut claim_requests = Vec :: with_capacity ( holder_tx. htlc_outputs . len ( ) ) ;
1492
- let mut watch_outputs = Vec :: with_capacity ( holder_tx. htlc_outputs . len ( ) ) ;
1493
1584
1494
1585
let redeemscript = chan_utils:: get_revokeable_redeemscript ( & holder_tx. revocation_key , self . on_holder_tx_csv , & holder_tx. delayed_payment_key ) ;
1495
1586
let broadcasted_holder_revokable_script = Some ( ( redeemscript. to_v0_p2wsh ( ) , holder_tx. per_commitment_point . clone ( ) , holder_tx. revocation_key . clone ( ) ) ) ;
@@ -1508,11 +1599,21 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
1508
1599
} else { None } ,
1509
1600
amount : htlc. amount_msat ,
1510
1601
} } ) ;
1511
- watch_outputs. push ( ( transaction_output_index, commitment_tx. output [ transaction_output_index as usize ] . clone ( ) ) ) ;
1512
1602
}
1513
1603
}
1514
1604
1515
- ( claim_requests, watch_outputs, broadcasted_holder_revokable_script)
1605
+ ( claim_requests, broadcasted_holder_revokable_script)
1606
+ }
1607
+
1608
+ // Returns holder HTLC outputs to watch and react to in case of spending.
1609
+ fn get_broadcasted_holder_watch_outputs ( & self , holder_tx : & HolderSignedTx , commitment_tx : & Transaction ) -> Vec < ( u32 , TxOut ) > {
1610
+ let mut watch_outputs = Vec :: with_capacity ( holder_tx. htlc_outputs . len ( ) ) ;
1611
+ for & ( ref htlc, _, _) in holder_tx. htlc_outputs . iter ( ) {
1612
+ if let Some ( transaction_output_index) = htlc. transaction_output_index {
1613
+ watch_outputs. push ( ( transaction_output_index, commitment_tx. output [ transaction_output_index as usize ] . clone ( ) ) ) ;
1614
+ }
1615
+ }
1616
+ watch_outputs
1516
1617
}
1517
1618
1518
1619
/// Attempts to claim any claimable HTLCs in a commitment transaction which was not (yet)
@@ -1547,10 +1648,10 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
1547
1648
}
1548
1649
1549
1650
macro_rules! append_onchain_update {
1550
- ( $updates: expr) => {
1651
+ ( $updates: expr, $to_watch : expr ) => {
1551
1652
claim_requests = $updates. 0 ;
1552
- watch_outputs . append ( & mut $updates. 1 ) ;
1553
- self . broadcasted_holder_revokable_script = $updates . 2 ;
1653
+ self . broadcasted_holder_revokable_script = $updates. 1 ;
1654
+ watch_outputs . append ( & mut $to_watch ) ;
1554
1655
}
1555
1656
}
1556
1657
@@ -1560,14 +1661,16 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
1560
1661
if self . current_holder_commitment_tx . txid == commitment_txid {
1561
1662
is_holder_tx = true ;
1562
1663
log_trace ! ( logger, "Got latest holder commitment tx broadcast, searching for available HTLCs to claim" ) ;
1563
- let mut res = self . broadcast_by_holder_state ( tx, & self . current_holder_commitment_tx ) ;
1564
- append_onchain_update ! ( res) ;
1664
+ let res = self . get_broadcasted_holder_claims ( & self . current_holder_commitment_tx ) ;
1665
+ let mut to_watch = self . get_broadcasted_holder_watch_outputs ( & self . current_holder_commitment_tx , tx) ;
1666
+ append_onchain_update ! ( res, to_watch) ;
1565
1667
} else if let & Some ( ref holder_tx) = & self . prev_holder_signed_commitment_tx {
1566
1668
if holder_tx. txid == commitment_txid {
1567
1669
is_holder_tx = true ;
1568
1670
log_trace ! ( logger, "Got previous holder commitment tx broadcast, searching for available HTLCs to claim" ) ;
1569
- let mut res = self . broadcast_by_holder_state ( tx, holder_tx) ;
1570
- append_onchain_update ! ( res) ;
1671
+ let res = self . get_broadcasted_holder_claims ( holder_tx) ;
1672
+ let mut to_watch = self . get_broadcasted_holder_watch_outputs ( holder_tx, tx) ;
1673
+ append_onchain_update ! ( res, to_watch) ;
1571
1674
}
1572
1675
}
1573
1676
@@ -1735,7 +1838,8 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
1735
1838
self . pending_monitor_events . push ( MonitorEvent :: CommitmentTxBroadcasted ( self . funding_info . 0 ) ) ;
1736
1839
if let Some ( commitment_tx) = self . onchain_tx_handler . get_fully_signed_holder_tx ( & self . funding_redeemscript ) {
1737
1840
self . holder_tx_signed = true ;
1738
- let ( mut new_outpoints, new_outputs, _) = self . broadcast_by_holder_state ( & commitment_tx, & self . current_holder_commitment_tx ) ;
1841
+ let ( mut new_outpoints, _) = self . get_broadcasted_holder_claims ( & self . current_holder_commitment_tx ) ;
1842
+ let new_outputs = self . get_broadcasted_holder_watch_outputs ( & self . current_holder_commitment_tx , & commitment_tx) ;
1739
1843
if !new_outputs. is_empty ( ) {
1740
1844
watch_outputs. push ( ( self . current_holder_commitment_tx . txid . clone ( ) , new_outputs) ) ;
1741
1845
}
@@ -1763,7 +1867,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
1763
1867
}
1764
1868
}
1765
1869
1766
- self . onchain_tx_handler . block_connected ( & txn_matched, claimable_outpoints, height, & * broadcaster, & * fee_estimator, & * logger) ;
1870
+ self . onchain_tx_handler . update_claims_view ( & txn_matched, claimable_outpoints, Some ( height) , & & * broadcaster, & & * fee_estimator, & & * logger) ;
1767
1871
self . last_block_hash = block_hash;
1768
1872
1769
1873
// Determine new outputs to watch by comparing against previously known outputs to watch,
@@ -2486,16 +2590,18 @@ mod tests {
2486
2590
use ln:: onchaintx:: { OnchainTxHandler , InputDescriptors } ;
2487
2591
use ln:: chan_utils;
2488
2592
use ln:: chan_utils:: { HTLCOutputInCommitment , HolderCommitmentTransaction } ;
2489
- use util:: test_utils:: TestLogger ;
2593
+ use util:: test_utils:: { TestLogger , TestBroadcaster , TestFeeEstimator } ;
2490
2594
use bitcoin:: secp256k1:: key:: { SecretKey , PublicKey } ;
2491
2595
use bitcoin:: secp256k1:: Secp256k1 ;
2492
- use std:: sync:: Arc ;
2596
+ use std:: sync:: { Arc , Mutex } ;
2493
2597
use chain:: keysinterface:: InMemoryChannelKeys ;
2494
2598
2495
2599
#[ test]
2496
2600
fn test_prune_preimages ( ) {
2497
2601
let secp_ctx = Secp256k1 :: new ( ) ;
2498
2602
let logger = Arc :: new ( TestLogger :: new ( ) ) ;
2603
+ let broadcaster = Arc :: new ( TestBroadcaster { txn_broadcasted : Mutex :: new ( Vec :: new ( ) ) } ) ;
2604
+ let fee_estimator = Arc :: new ( TestFeeEstimator { sat_per_kw : 253 } ) ;
2499
2605
2500
2606
let dummy_key = PublicKey :: from_secret_key ( & secp_ctx, & SecretKey :: from_slice ( & [ 42 ; 32 ] ) . unwrap ( ) ) ;
2501
2607
let dummy_tx = Transaction { version : 0 , lock_time : 0 , input : Vec :: new ( ) , output : Vec :: new ( ) } ;
@@ -2571,7 +2677,7 @@ mod tests {
2571
2677
monitor. provide_latest_counterparty_commitment_tx_info ( & dummy_tx, preimages_slice_to_htlc_outputs ! ( preimages[ 17 ..20 ] ) , 281474976710653 , dummy_key, & logger) ;
2572
2678
monitor. provide_latest_counterparty_commitment_tx_info ( & dummy_tx, preimages_slice_to_htlc_outputs ! ( preimages[ 18 ..20 ] ) , 281474976710652 , dummy_key, & logger) ;
2573
2679
for & ( ref preimage, ref hash) in preimages. iter ( ) {
2574
- monitor. provide_payment_preimage ( hash, preimage) ;
2680
+ monitor. provide_payment_preimage ( hash, preimage, & broadcaster , & fee_estimator , & logger ) ;
2575
2681
}
2576
2682
2577
2683
// Now provide a secret, pruning preimages 10-15
0 commit comments