Skip to content

Commit 318a244

Browse files
committed
fixup: Asset TRUC transactions are below 10_000 WU in check_spends
1 parent 8ef82ff commit 318a244

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lightning/src/ln/functional_test_utils.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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+
};
2527
use 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>(
19411943
pub 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

Comments
 (0)