Skip to content

Commit 55ce31e

Browse files
committed
f - use LN_MAX_MSG_LEN
1 parent 5996175 commit 55ce31e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ use crate::chain::transaction::{OutPoint, TransactionData};
3939
use crate::chain::BestBlock;
4040
use crate::events::bump_transaction::BASE_INPUT_WEIGHT;
4141
use crate::events::ClosureReason;
42-
use crate::ln::chan_utils;
4342
#[cfg(splicing)]
4443
use crate::ln::chan_utils::FUNDING_TRANSACTION_WITNESS_WEIGHT;
4544
use crate::ln::chan_utils::{
@@ -72,6 +71,7 @@ use crate::ln::onion_utils::{
7271
};
7372
use crate::ln::script::{self, ShutdownScript};
7473
use crate::ln::types::ChannelId;
74+
use crate::ln::{chan_utils, LN_MAX_MSG_LEN};
7575
use crate::routing::gossip::NodeId;
7676
use crate::sign::ecdsa::EcdsaChannelSigner;
7777
use crate::sign::tx_builder::{SpecTxBuilder, TxBuilder};
@@ -10678,7 +10678,7 @@ where
1067810678
shared_input_txid: None,
1067910679
};
1068010680
let message_len = MESSAGE_TEMPLATE.serialized_length() + tx.serialized_length();
10681-
if message_len > u16::MAX as usize {
10681+
if message_len > LN_MAX_MSG_LEN {
1068210682
return Err(APIError::APIMisuseError {
1068310683
err: format!("Funding input's prevtx is too large for tx_add_input"),
1068410684
});

0 commit comments

Comments
 (0)