You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lightning/src/ln/channel.rs
+20-20
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ use ln::msgs;
28
28
use ln::msgs::{DecodeError,OptionalField,DataLossProtect};
29
29
use ln::script::{self,ShutdownScript};
30
30
use ln::channelmanager::{CounterpartyForwardingInfo,PendingHTLCStatus,HTLCSource,HTLCFailReason,HTLCFailureMsg,PendingHTLCInfo,RAACommitmentOrder,BREAKDOWN_TIMEOUT,MIN_CLTV_EXPIRY_DELTA,MAX_LOCAL_BREAKDOWN_TIMEOUT};
31
-
use ln::chan_utils::{CounterpartyCommitmentSecrets,TxCreationKeys,HTLCOutputInCommitment,HTLC_SUCCESS_TX_WEIGHT,HTLC_TIMEOUT_TX_WEIGHT, make_funding_redeemscript,ChannelPublicKeys,CommitmentTransaction,HolderCommitmentTransaction,ChannelTransactionParameters,CounterpartyChannelTransactionParameters,MAX_HTLCS, get_commitment_transaction_number_obscure_factor,ClosingTransaction};
31
+
use ln::chan_utils::{CounterpartyCommitmentSecrets,TxCreationKeys,HTLCOutputInCommitment,htlc_success_tx_weight, htlc_timeout_tx_weight, make_funding_redeemscript,ChannelPublicKeys,CommitmentTransaction,HolderCommitmentTransaction,ChannelTransactionParameters,CounterpartyChannelTransactionParameters,MAX_HTLCS, get_commitment_transaction_number_obscure_factor,ClosingTransaction};
32
32
use ln::chan_utils;
33
33
use chain::BestBlock;
34
34
use chain::chaininterface::{FeeEstimator,ConfirmationTarget};
let exposure_dust_limit_timeout_sats = (self.get_dust_buffer_feerate(None)asu64*HTLC_TIMEOUT_TX_WEIGHT / 1000) + self.holder_dust_limit_satoshis;
4773
+
let exposure_dust_limit_timeout_sats = (self.get_dust_buffer_feerate(None)asu64*htlc_timeout_tx_weight(self.opt_anchors()) / 1000) + self.holder_dust_limit_satoshis;
4774
4774
if amount_msat / 1000 < exposure_dust_limit_timeout_sats {
4775
4775
let on_holder_dust_htlc_exposure_msat = inbound_stats.on_holder_tx_dust_exposure_msat + outbound_stats.on_holder_tx_dust_exposure_msat + amount_msat;
4776
4776
if on_holder_dust_htlc_exposure_msat > self.get_max_dust_htlc_exposure_msat(){
@@ -5815,7 +5815,7 @@ mod tests {
5815
5815
use ln::msgs::{ChannelUpdate,DataLossProtect,DecodeError,OptionalField,UnsignedChannelUpdate};
5816
5816
use ln::script::ShutdownScript;
5817
5817
use ln::chan_utils;
5818
-
use ln::chan_utils::{ChannelPublicKeys,HolderCommitmentTransaction,CounterpartyChannelTransactionParameters,HTLC_SUCCESS_TX_WEIGHT,HTLC_TIMEOUT_TX_WEIGHT};
5818
+
use ln::chan_utils::{ChannelPublicKeys,HolderCommitmentTransaction,CounterpartyChannelTransactionParameters,htlc_success_tx_weight, htlc_timeout_tx_weight};
5819
5819
use chain::BestBlock;
5820
5820
use chain::chaininterface::{FeeEstimator,ConfirmationTarget};
5821
5821
use chain::keysinterface::{InMemorySigner,KeyMaterial,KeysInterface,BaseSign};
@@ -6027,27 +6027,27 @@ mod tests {
6027
6027
6028
6028
// If HTLC_SUCCESS_TX_WEIGHT and HTLC_TIMEOUT_TX_WEIGHT were swapped: then this HTLC would be
6029
6029
// counted as dust when it shouldn't be.
6030
-
let htlc_amt_above_timeout = ((253*HTLC_TIMEOUT_TX_WEIGHT / 1000) + chan.holder_dust_limit_satoshis + 1)*1000;
6030
+
let htlc_amt_above_timeout = ((253*htlc_timeout_tx_weight(chan.opt_anchors()) / 1000) + chan.holder_dust_limit_satoshis + 1)*1000;
6031
6031
let htlc_candidate = HTLCCandidate::new(htlc_amt_above_timeout,HTLCInitiator::LocalOffered);
6032
6032
let commitment_tx_fee = chan.next_local_commit_tx_fee_msat(htlc_candidate,None);
Copy file name to clipboardExpand all lines: lightning/src/ln/functional_tests.rs
+6-4
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ use ln::channel::{COMMITMENT_TX_BASE_WEIGHT, COMMITMENT_TX_WEIGHT_PER_HTLC, CONC
22
22
use ln::channelmanager::{ChannelManager,ChannelManagerReadArgs,PaymentId,RAACommitmentOrder,PaymentSendFailure,BREAKDOWN_TIMEOUT,MIN_CLTV_EXPIRY_DELTA,PAYMENT_EXPIRY_BLOCKS};
23
23
use ln::channel::{Channel,ChannelError};
24
24
use ln::{chan_utils, onion_utils};
25
-
use ln::chan_utils::{HTLC_SUCCESS_TX_WEIGHT,HTLC_TIMEOUT_TX_WEIGHT,HTLCOutputInCommitment};
25
+
use ln::chan_utils::{htlc_success_tx_weight, htlc_timeout_tx_weight,HTLCOutputInCommitment};
26
26
use routing::network_graph::RoutingFees;
27
27
use routing::router::{Payee,Route,RouteHop,RouteHint,RouteHintHop,RouteParameters, find_route, get_route};
28
28
use ln::features::{ChannelFeatures,InitFeatures,InvoiceFeatures,NodeFeatures};
0 commit comments