@@ -21,7 +21,9 @@ use crate::events::{
2121 ClaimedHTLC , ClosureReason , Event , HTLCHandlingFailureType , PaidBolt12Invoice , PathFailure ,
2222 PaymentFailureReason , PaymentPurpose ,
2323} ;
24- use crate :: ln:: chan_utils:: { commitment_tx_base_weight, COMMITMENT_TX_WEIGHT_PER_HTLC } ;
24+ use crate :: ln:: chan_utils:: {
25+ commitment_tx_base_weight, COMMITMENT_TX_WEIGHT_PER_HTLC , MAX_TRUC_WEIGHT ,
26+ } ;
2527use crate :: ln:: channelmanager:: {
2628 AChannelManager , ChainParameters , ChannelManager , ChannelManagerReadArgs , PaymentId ,
2729 RAACommitmentOrder , RecipientOnionFields , MIN_CLTV_EXPIRY_DELTA ,
@@ -1941,6 +1943,9 @@ pub fn update_nodes_with_chan_announce<'a, 'b, 'c, 'd>(
19411943pub fn do_check_spends < F : Fn ( & bitcoin:: transaction:: OutPoint ) -> Option < TxOut > > (
19421944 tx : & Transaction , get_output : F ,
19431945) {
1946+ if tx. version == TxVersion :: non_standard ( 3 ) {
1947+ assert ! ( tx. weight( ) . to_wu( ) <= MAX_TRUC_WEIGHT ) ;
1948+ }
19441949 let mut p2a_output_below_dust = false ;
19451950 let mut has_p2a_output = false ;
19461951 for outp in tx. output . iter ( ) {
0 commit comments