use crate::chain::chaininterface::compute_feerate_sat_per_1000_weight;
use crate::sign::{ChannelDerivationParameters, HTLCDescriptor, ChannelSigner, EntropySource, SignerProvider, ecdsa::WriteableEcdsaChannelSigner};
use crate::ln::msgs::DecodeError;
-use crate::ln::PaymentPreimage;
+use crate::ln::types::PaymentPreimage;
use crate::ln::chan_utils::{self, ChannelTransactionParameters, HTLCOutputInCommitment, HolderCommitmentTransaction};
use crate::chain::ClaimId;
use crate::chain::chaininterface::{ConfirmationTarget, FeeEstimator, BroadcasterInterface, LowerBoundedFeeEstimator};
B::Target: BroadcasterInterface,
F::Target: FeeEstimator,
{
- log_debug!(logger, "Updating claims view at height {} with {} claim requests", cur_height, requests.len());
+ if !requests.is_empty() {
+ log_debug!(logger, "Updating claims view at height {} with {} claim requests", cur_height, requests.len());
+ }
+
let mut preprocessed_requests = Vec::with_capacity(requests.len());
let mut aggregated_request = None;
// Claim everything up to and including `cur_height`
let remaining_locked_packages = self.locktimed_packages.split_off(&(cur_height + 1));
+ if !self.locktimed_packages.is_empty() {
+ log_debug!(logger,
+ "Updating claims view at height {} with {} locked packages available for claim",
+ cur_height,
+ self.locktimed_packages.len());
+ }
for (pop_height, mut entry) in self.locktimed_packages.iter_mut() {
log_trace!(logger, "Restoring delayed claim of package(s) at their timelock at {}.", pop_height);
preprocessed_requests.append(&mut entry);
B::Target: BroadcasterInterface,
F::Target: FeeEstimator,
{
- log_debug!(logger, "Updating claims view at height {} with {} matched transactions in block {}", cur_height, txn_matched.len(), conf_height);
+ let mut have_logged_intro = false;
+ let mut maybe_log_intro = || {
+ if !have_logged_intro {
+ log_debug!(logger, "Updating claims view at height {} with {} matched transactions in block {}", cur_height, txn_matched.len(), conf_height);
+ have_logged_intro = true;
+ }
+ };
let mut bump_candidates = new_hash_map();
+ if !txn_matched.is_empty() { maybe_log_intro(); }
for tx in txn_matched {
// Scan all input to verify is one of the outpoint spent is of interest for us
let mut claimed_outputs_material = Vec::new();
self.onchain_events_awaiting_threshold_conf.drain(..).collect::<Vec<_>>();
for entry in onchain_events_awaiting_threshold_conf {
if entry.has_reached_confirmation_threshold(cur_height) {
+ maybe_log_intro();
match entry.event {
OnchainEvent::Claim { claim_id } => {
// We may remove a whole set of claim outpoints here, as these one may have
}
// Build, bump and rebroadcast tx accordingly
- log_trace!(logger, "Bumping {} candidates", bump_candidates.len());
+ if !bump_candidates.is_empty() {
+ maybe_log_intro();
+ log_trace!(logger, "Bumping {} candidates", bump_candidates.len());
+ }
+
for (claim_id, request) in bump_candidates.iter() {
if let Some((new_timer, new_feerate, bump_claim)) = self.generate_claim(
cur_height, &request, &FeerateStrategy::ForceBump, &*fee_estimator, &*logger,