//! OnchainTxHandler objects are fully-part of ChannelMonitor and encapsulates all
//! building, tracking, bumping and notifications functions.
+use bitcoin::amount::Amount;
use bitcoin::blockdata::locktime::absolute::LockTime;
use bitcoin::blockdata::transaction::Transaction;
use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint;
}
}
+ /// Returns true if we are currently tracking any pending claim requests that are not fully
+ /// confirmed yet.
+ pub(super) fn has_pending_claims(&self) -> bool
+ {
+ self.pending_claim_requests.len() != 0
+ }
+
/// Lightning security model (i.e being able to redeem/timeout HTLC or penalize counterparty
/// onchain) lays on the assumption of claim transactions getting confirmed before timelock
/// expiration (CSV or CLTV following cases). In case of high-fee spikes, claim tx may get stuck
assert!(new_feerate != 0);
let transaction = cached_request.maybe_finalize_malleable_package(
- cur_height, self, output_value, self.destination_script.clone(), logger
+ cur_height, self, Amount::from_sat(output_value), self.destination_script.clone(), logger
).unwrap();
assert!(predicted_weight >= transaction.0.weight().to_wu());
return Some((new_timer, new_feerate, OnchainClaim::Tx(transaction)));
let package_target_feerate_sat_per_1000_weight = cached_request
.compute_package_feerate(fee_estimator, conf_target, feerate_strategy);
if let Some(input_amount_sat) = output.funding_amount {
- let fee_sat = input_amount_sat - tx.0.output.iter().map(|output| output.value).sum::<u64>();
+ let fee_sat = input_amount_sat - tx.0.output.iter().map(|output| output.value.to_sat()).sum::<u64>();
let commitment_tx_feerate_sat_per_1000_weight =
compute_feerate_sat_per_1000_weight(fee_sat, tx.0.weight().to_wu());
if commitment_tx_feerate_sat_per_1000_weight >= package_target_feerate_sat_per_1000_weight {