Merge pull request #2382 from dunxen/2077-followups
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Thu, 20 Jul 2023 21:40:04 +0000 (21:40 +0000)
committerGitHub <noreply@github.com>
Thu, 20 Jul 2023 21:40:04 +0000 (21:40 +0000)
Address outstanding 2077 feedback

1  2 
lightning/src/chain/onchaintx.rs

index f7071bf0ce6b2c62474bb6b01a0e31797794caec,beb0dfc10353eabe0b9339fd67bdca22f988edae..6ac4973a74441de88461576d26c9f8b69545d1c8
@@@ -633,12 -633,11 +633,12 @@@ impl<ChannelSigner: WriteableEcdsaChann
                                                .compute_package_feerate(fee_estimator, conf_target, force_feerate_bump);
                                        if let Some(input_amount_sat) = output.funding_amount {
                                                let fee_sat = input_amount_sat - tx.output.iter().map(|output| output.value).sum::<u64>();
 -                                              if compute_feerate_sat_per_1000_weight(fee_sat, tx.weight() as u64) >=
 -                                                       package_target_feerate_sat_per_1000_weight
 -                                              {
 -                                                      log_debug!(logger, "Commitment transaction {} already meets required feerate {} sat/kW",
 -                                                              tx.txid(), package_target_feerate_sat_per_1000_weight);
 +                                              let commitment_tx_feerate_sat_per_1000_weight =
 +                                                      compute_feerate_sat_per_1000_weight(fee_sat, tx.weight() as u64);
 +                                              if commitment_tx_feerate_sat_per_1000_weight >= package_target_feerate_sat_per_1000_weight {
 +                                                      log_debug!(logger, "Pre-signed {} already has feerate {} sat/kW above required {} sat/kW",
 +                                                              log_tx!(tx), commitment_tx_feerate_sat_per_1000_weight,
 +                                                              package_target_feerate_sat_per_1000_weight);
                                                        return Some((new_timer, 0, OnchainClaim::Tx(tx.clone())));
                                                }
                                        }
        }
  
        //TODO: getting lastest holder transactions should be infallible and result in us "force-closing the channel", but we may
-       // have empty holder commitment transaction if a ChannelMonitor is asked to force-close just after Channel::get_outbound_funding_created,
+       // have empty holder commitment transaction if a ChannelMonitor is asked to force-close just after OutboundV1Channel::get_funding_created,
        // before providing a initial commitment transaction. For outbound channel, init ChannelMonitor at Channel::funding_signed, there is nothing
        // to monitor before.
        pub(crate) fn get_fully_signed_holder_tx(&mut self, funding_redeemscript: &Script) -> Transaction {