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-20Lines changed: 20 additions & 20 deletions
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;
4778
+
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;
4779
4779
if amount_msat / 1000 < exposure_dust_limit_timeout_sats {
4780
4780
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;
4781
4781
if on_holder_dust_htlc_exposure_msat > self.get_max_dust_htlc_exposure_msat(){
@@ -5820,7 +5820,7 @@ mod tests {
5820
5820
use ln::msgs::{ChannelUpdate,DataLossProtect,DecodeError,OptionalField,UnsignedChannelUpdate};
5821
5821
use ln::script::ShutdownScript;
5822
5822
use ln::chan_utils;
5823
-
use ln::chan_utils::{ChannelPublicKeys,HolderCommitmentTransaction,CounterpartyChannelTransactionParameters,HTLC_SUCCESS_TX_WEIGHT,HTLC_TIMEOUT_TX_WEIGHT};
5823
+
use ln::chan_utils::{ChannelPublicKeys,HolderCommitmentTransaction,CounterpartyChannelTransactionParameters,htlc_success_tx_weight, htlc_timeout_tx_weight};
5824
5824
use chain::BestBlock;
5825
5825
use chain::chaininterface::{FeeEstimator,ConfirmationTarget};
5826
5826
use chain::keysinterface::{InMemorySigner,KeyMaterial,KeysInterface,BaseSign};
@@ -6032,27 +6032,27 @@ mod tests {
6032
6032
6033
6033
// If HTLC_SUCCESS_TX_WEIGHT and HTLC_TIMEOUT_TX_WEIGHT were swapped: then this HTLC would be
6034
6034
// counted as dust when it shouldn't be.
6035
-
let htlc_amt_above_timeout = ((253*HTLC_TIMEOUT_TX_WEIGHT / 1000) + chan.holder_dust_limit_satoshis + 1)*1000;
6035
+
let htlc_amt_above_timeout = ((253*htlc_timeout_tx_weight(chan.opt_anchors()) / 1000) + chan.holder_dust_limit_satoshis + 1)*1000;
6036
6036
let htlc_candidate = HTLCCandidate::new(htlc_amt_above_timeout,HTLCInitiator::LocalOffered);
6037
6037
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-4Lines changed: 6 additions & 4 deletions
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