@@ -21,7 +21,9 @@ use crate::events::{
21
21
ClaimedHTLC , ClosureReason , Event , HTLCHandlingFailureType , PaidBolt12Invoice , PathFailure ,
22
22
PaymentFailureReason , PaymentPurpose ,
23
23
} ;
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
+ } ;
25
27
use crate :: ln:: channelmanager:: {
26
28
AChannelManager , ChainParameters , ChannelManager , ChannelManagerReadArgs , PaymentId ,
27
29
RAACommitmentOrder , RecipientOnionFields , MIN_CLTV_EXPIRY_DELTA ,
@@ -1941,6 +1943,9 @@ pub fn update_nodes_with_chan_announce<'a, 'b, 'c, 'd>(
1941
1943
pub fn do_check_spends < F : Fn ( & bitcoin:: transaction:: OutPoint ) -> Option < TxOut > > (
1942
1944
tx : & Transaction , get_output : F ,
1943
1945
) {
1946
+ if tx. version == TxVersion :: non_standard ( 3 ) {
1947
+ assert ! ( tx. weight( ) . to_wu( ) <= MAX_TRUC_WEIGHT ) ;
1948
+ }
1944
1949
let mut p2a_output_below_dust = false ;
1945
1950
let mut has_p2a_output = false ;
1946
1951
for outp in tx. output . iter ( ) {
0 commit comments