@@ -15,7 +15,7 @@ use crate::sign::EntropySource;
1515use crate :: chain:: channelmonitor:: ChannelMonitor ;
1616use crate :: chain:: transaction:: OutPoint ;
1717use 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 } ;
1919use crate :: ln:: { ChannelId , PaymentPreimage , PaymentHash , PaymentSecret } ;
2020use crate :: ln:: channelmanager:: { AChannelManager , ChainParameters , ChannelManager , ChannelManagerReadArgs , RAACommitmentOrder , PaymentSendFailure , RecipientOnionFields , PaymentId , MIN_CLTV_EXPIRY_DELTA } ;
2121use crate :: routing:: gossip:: { P2PGossipSync , NetworkGraph , NetworkUpdate } ;
@@ -1504,6 +1504,21 @@ macro_rules! check_closed_event {
15041504 }
15051505}
15061506
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+
15071522pub 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 ) {
15081523 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) } ;
15091524 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
27802795}
27812796
27822797// 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
27842800
27852801#[ derive( PartialEq ) ]
27862802pub enum HTLCType { NONE , TIMEOUT , SUCCESS }
0 commit comments