X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fpackage.rs;h=e66092222d83ad4b583db839ea08e94da0751ce4;hb=2ddce64ba6b5e5ee7db206cc9f7321855473ec88;hp=b3f6f50ed1d17fb390c04a2995eb98e9ef3fd558;hpb=5f96d1334435e74545670a5dff24078edf749d60;p=rust-lightning diff --git a/lightning/src/chain/package.rs b/lightning/src/chain/package.rs index b3f6f50e..e6609222 100644 --- a/lightning/src/chain/package.rs +++ b/lightning/src/chain/package.rs @@ -25,7 +25,7 @@ use crate::ln::chan_utils::{TxCreationKeys, HTLCOutputInCommitment}; use crate::ln::chan_utils; use crate::ln::msgs::DecodeError; use crate::chain::chaininterface::{FeeEstimator, ConfirmationTarget, MIN_RELAY_FEE_SAT_PER_1000_WEIGHT}; -use crate::chain::keysinterface::WriteableEcdsaChannelSigner; +use crate::sign::WriteableEcdsaChannelSigner; #[cfg(anchors)] use crate::chain::onchaintx::ExternalHTLCClaim; use crate::chain::onchaintx::OnchainTxHandler; @@ -460,13 +460,13 @@ impl PackageSolvingData { } } fn absolute_tx_timelock(&self, current_height: u32) -> u32 { - // We use `current_height + 1` as our default locktime to discourage fee sniping and because + // We use `current_height` as our default locktime to discourage fee sniping and because // transactions with it always propagate. let absolute_timelock = match self { - PackageSolvingData::RevokedOutput(_) => current_height + 1, - PackageSolvingData::RevokedHTLCOutput(_) => current_height + 1, - PackageSolvingData::CounterpartyOfferedHTLCOutput(_) => current_height + 1, - PackageSolvingData::CounterpartyReceivedHTLCOutput(ref outp) => cmp::max(outp.htlc.cltv_expiry, current_height + 1), + PackageSolvingData::RevokedOutput(_) => current_height, + PackageSolvingData::RevokedHTLCOutput(_) => current_height, + PackageSolvingData::CounterpartyOfferedHTLCOutput(_) => current_height, + PackageSolvingData::CounterpartyReceivedHTLCOutput(ref outp) => cmp::max(outp.htlc.cltv_expiry, current_height), // HTLC timeout/success transactions rely on a fixed timelock due to the counterparty's // signature. PackageSolvingData::HolderHTLCOutput(ref outp) => { @@ -475,7 +475,7 @@ impl PackageSolvingData { } outp.cltv_expiry }, - PackageSolvingData::HolderFundingOutput(_) => current_height + 1, + PackageSolvingData::HolderFundingOutput(_) => current_height, }; absolute_timelock }