@@ -15,7 +15,7 @@ use crate::sign::EntropySource;
15
15
use crate :: chain:: channelmonitor:: ChannelMonitor ;
16
16
use crate :: chain:: transaction:: OutPoint ;
17
17
use crate :: events:: { ClaimedHTLC , ClosureReason , Event , HTLCDestination , MessageSendEvent , MessageSendEventsProvider , PathFailure , PaymentPurpose , PaymentFailureReason } ;
18
- use crate :: events:: bump_transaction:: { BumpTransactionEventHandler , Wallet , WalletSource } ;
18
+ use crate :: events:: bump_transaction:: { BumpTransactionEvent , BumpTransactionEventHandler , Wallet , WalletSource } ;
19
19
use crate :: ln:: { ChannelId , PaymentPreimage , PaymentHash , PaymentSecret } ;
20
20
use crate :: ln:: channelmanager:: { AChannelManager , ChainParameters , ChannelManager , ChannelManagerReadArgs , RAACommitmentOrder , PaymentSendFailure , RecipientOnionFields , PaymentId , MIN_CLTV_EXPIRY_DELTA } ;
21
21
use crate :: routing:: gossip:: { P2PGossipSync , NetworkGraph , NetworkUpdate } ;
@@ -1504,6 +1504,21 @@ macro_rules! check_closed_event {
1504
1504
}
1505
1505
}
1506
1506
1507
+ pub fn handle_bump_htlc_event ( node : & Node , count : usize ) {
1508
+ let events = node. chain_monitor . chain_monitor . get_and_clear_pending_events ( ) ;
1509
+ assert_eq ! ( events. len( ) , count) ;
1510
+ for event in events {
1511
+ match event {
1512
+ Event :: BumpTransaction ( bump_event) => {
1513
+ if let BumpTransactionEvent :: HTLCResolution { .. } = & bump_event { }
1514
+ else { panic ! ( ) ; }
1515
+ node. bump_tx_handler . handle_event ( & bump_event) ;
1516
+ } ,
1517
+ _ => panic ! ( ) ,
1518
+ }
1519
+ }
1520
+ }
1521
+
1507
1522
pub fn close_channel < ' a , ' b , ' c > ( outbound_node : & Node < ' a , ' b , ' c > , inbound_node : & Node < ' a , ' b , ' c > , channel_id : & ChannelId , funding_tx : Transaction , close_inbound_first : bool ) -> ( msgs:: ChannelUpdate , msgs:: ChannelUpdate , Transaction ) {
1508
1523
let ( node_a, broadcaster_a, struct_a) = if close_inbound_first { ( & inbound_node. node , & inbound_node. tx_broadcaster , inbound_node) } else { ( & outbound_node. node , & outbound_node. tx_broadcaster , outbound_node) } ;
1509
1524
let ( node_b, broadcaster_b, struct_b) = if close_inbound_first { ( & outbound_node. node , & outbound_node. tx_broadcaster , outbound_node) } else { ( & inbound_node. node , & inbound_node. tx_broadcaster , inbound_node) } ;
@@ -2780,7 +2795,8 @@ pub fn create_network<'a, 'b: 'a, 'c: 'b>(node_count: usize, cfgs: &'b Vec<NodeC
2780
2795
}
2781
2796
2782
2797
// Note that the following only works for CLTV values up to 128
2783
- pub const ACCEPTED_HTLC_SCRIPT_WEIGHT : usize = 137 ; //Here we have a diff due to HTLC CLTV expiry being < 2^15 in test
2798
+ pub const ACCEPTED_HTLC_SCRIPT_WEIGHT : usize = 137 ; // Here we have a diff due to HTLC CLTV expiry being < 2^15 in test
2799
+ pub const ACCEPTED_HTLC_SCRIPT_WEIGHT_ANCHORS : usize = 140 ; // Here we have a diff due to HTLC CLTV expiry being < 2^15 in test
2784
2800
2785
2801
#[ derive( PartialEq ) ]
2786
2802
pub enum HTLCType { NONE , TIMEOUT , SUCCESS }
0 commit comments