X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fpackage.rs;h=7ea61dc244976c2257087b91ade479d5aa758832;hb=101c09f9bf04783b5d1f5b77bc50ed6735800828;hp=5974a65d2a3e7527102c57cd8781a66d4a4b21e6;hpb=e496d62b98b7d7cd1800fe0dbf70684866fed7e7;p=rust-lightning diff --git a/lightning/src/chain/package.rs b/lightning/src/chain/package.rs index 5974a65d..7ea61dc2 100644 --- a/lightning/src/chain/package.rs +++ b/lightning/src/chain/package.rs @@ -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 } @@ -554,6 +554,9 @@ impl PackageTemplate { pub(crate) fn aggregable(&self) -> bool { self.aggregable } + pub(crate) fn previous_feerate(&self) -> u64 { + self.feerate_previous + } pub(crate) fn set_feerate(&mut self, new_feerate: u64) { self.feerate_previous = new_feerate; }