Drop Deref indirection for FeeEstimator
What changed, and why it matters
This commit is a large but mechanical cleanup of the Rust code. It removes an unnecessary layer of pointer-wrapping (the `Deref` indirection) around the fee-estimator type used throughout the Lightning library. Instead of requiring a generic pointer that points to something implementing `FeeEstimator`, the code now directly requires a type that implements `FeeEstimator`. The commit also adds a blanket implementation so that any pointer/reference to a `FeeEstimator` still automatically counts as a `FeeEstimator`. The stated goal is to reduce generics and verbosity while keeping behavior the same. There is no direct evidence in the commit of a security vulnerability being fixed.
No immediate security action required. Treat as a normal code-quality refactor. Reviewers should verify that the new blanket `FeeEstimator` implementation and the simplified `LowerBoundedFeeEstimator` bounds do not accidentally allow types that previously failed the `F::Target: FeeEstimator` constraint, and that downstream users' type parameters still compile. Regression tests and a full `cargo check`/`cargo test` run are appropriate.
Security signals we found
Large refactor touching fee-estimator plumbing across chain monitor, channel monitor, channel manager, persister, and sweeper.
No changes to fee-estimation arithmetic, floor constants, or transaction validation logic.
No mention of security, CVE, bug fix, or vulnerability in commit message or diff.
No new unsafe blocks, no new unwraps/panics, no new network parsing, no new cryptographic operations.
Blanket trait impl preserves backward compatibility for existing `Arc<dyn FeeEstimator>` / `&FeeEstimator` callers.
Evidence from the diff
The patch refactors generic bounds across 14 files from F: Deref where F::Target: FeeEstimator to F: FeeEstimator, and introduces impl<T: FeeEstimator + ?Sized, F: Deref<Target = T>> FeeEstimator for F in chaininterface.rs so references/smart-pointers to fee estimators still implement the trait. LowerBoundedFeeEstimator is simplified from LowerBoundedFeeEstimator<F: Deref> to LowerBoundedFeeEstimator<F: FeeEstimator>. Call sites drop explicit &*/&** dereferences (e.g., &*self.fee_estimator becomes &self.fee_estimator). The AChannelManager trait loses its separate F associated type and now exposes only FeeEstimator. These are type-system ergonomics changes; no logic changes to fee calculation, bounding, or transaction construction are visible.
Changed components
lightning/src/chain/chaininterface.rslightning/src/chain/chainmonitor.rslightning/src/chain/channelmonitor.rslightning/src/chain/onchaintx.rslightning/src/chain/package.rslightning/src/ln/chan_utils.rslightning/src/ln/channel.rslightning/src/ln/channel_state.rslightning/src/ln/channelmanager.rslightning/src/ln/functional_test_utils.rslightning/src/util/anchor_channel_reserves.rslightning/src/util/persist.rslightning/src/util/sweep.rslightning-background-processor/src/lib.rsInspect captured patch +272 / −378
diff --git a/lightning-background-processor/src/lib.rs b/lightning-background-processor/src/lib.rs
index 6731dae..941de6b 100644
--- a/lightning-background-processor/src/lib.rs
+++ b/lightning-background-processor/src/lib.rs
@@ -949,7 +949,7 @@ pub async fn process_events_async<
UL: Deref,
CF: Deref,
T: BroadcasterInterface,
- F: Deref,
+ F: FeeEstimator,
G: Deref<Target = NetworkGraph<L>>,
L: Deref,
P: Deref,
@@ -981,7 +981,6 @@ pub async fn process_events_async<
where
UL::Target: UtxoLookup,
CF::Target: chain::Filter,
- F::Target: FeeEstimator,
L::Target: Logger,
P::Target: Persist<<CM::Target as AChannelManager>::Signer>,
CM::Target: AChannelManager,
@@ -1448,7 +1447,7 @@ pub async fn process_events_async_with_kv_store_sync<
UL: Deref,
CF: Deref,
T: BroadcasterInterface,
- F: Deref,
+ F: FeeEstimator,
G: Deref<Target = NetworkGraph<L>>,
L: Deref,
P: Deref,
@@ -1480,7 +1479,6 @@ pub async fn process_events_async_with_kv_store_sync<
where
UL::Target: UtxoLookup,
CF::Target: chain::Filter,
- F::Target: FeeEstimator,
L::Target: Logger,
P::Target: Persist<<CM::Target as AChannelManager>::Signer>,
CM::Target: AChannelManager,
@@ -1560,7 +1558,7 @@ impl BackgroundProcessor {
UL: 'static + Deref,
CF: 'static + Deref,
T: 'static + BroadcasterInterface,
- F: 'static + Deref + Send,
+ F: 'static + FeeEstimator + Send,
G: 'static + Deref<Target = NetworkGraph<L>>,
L: 'static + Deref + Send,
P: 'static + Deref,
@@ -1592,7 +1590,6 @@ impl BackgroundProcessor {
where
UL::Target: 'static + UtxoLookup,
CF::Target: 'static + chain::Filter,
- F::Target: 'static + FeeEstimator,
L::Target: 'static + Logger,
P::Target: 'static + Persist<<CM::Target as AChannelManager>::Signer>,
CM::Target: AChannelManager,
diff --git a/lightning/src/chain/chaininterface.rs b/lightning/src/chain/chaininterface.rs
index d21017c..7e71d96 100644
--- a/lightning/src/chain/chaininterface.rs
+++ b/lightning/src/chain/chaininterface.rs
@@ -187,6 +187,12 @@ pub trait FeeEstimator {
fn get_est_sat_per_1000_weight(&self, confirmation_target: ConfirmationTarget) -> u32;
}
+impl<T: FeeEstimator + ?Sized, F: Deref<Target = T>> FeeEstimator for F {
+ fn get_est_sat_per_1000_weight(&self, confirmation_target: ConfirmationTarget) -> u32 {
+ self.deref().get_est_sat_per_1000_weight(confirmation_target)
+ }
+}
+
/// Minimum relay fee as required by bitcoin network mempool policy.
pub const INCREMENTAL_RELAY_FEE_SAT_PER_1000_WEIGHT: u64 = 253;
/// Minimum feerate that takes a sane approach to bitcoind weight-to-vbytes rounding.
@@ -194,19 +200,14 @@ pub const INCREMENTAL_RELAY_FEE_SAT_PER_1000_WEIGHT: u64 = 253;
/// <https://github.com/ElementsProject/lightning/commit/2e687b9b352c9092b5e8bd4a688916ac50b44af0>
pub const FEERATE_FLOOR_SATS_PER_KW: u32 = 253;
-/// Wraps a `Deref` to a `FeeEstimator` so that any fee estimations provided by it
-/// are bounded below by `FEERATE_FLOOR_SATS_PER_KW` (253 sats/KW).
+/// Wraps a [`FeeEstimator`] so that any fee estimations provided by it are bounded below by
+/// `FEERATE_FLOOR_SATS_PER_KW` (253 sats/KW).
///
/// Note that this does *not* implement [`FeeEstimator`] to make it harder to accidentally mix the
/// two.
-pub(crate) struct LowerBoundedFeeEstimator<F: Deref>(pub F)
-where
- F::Target: FeeEstimator;
+pub(crate) struct LowerBoundedFeeEstimator<F: FeeEstimator>(pub F);
-impl<F: Deref> LowerBoundedFeeEstimator<F>
-where
- F::Target: FeeEstimator,
-{
+impl<F: FeeEstimator> LowerBoundedFeeEstimator<F> {
/// Creates a new `LowerBoundedFeeEstimator` which wraps the provided fee_estimator
pub fn new(fee_estimator: F) -> Self {
LowerBoundedFeeEstimator(fee_estimator)
diff --git a/lightning/src/chain/chainmonitor.rs b/lightning/src/chain/chainmonitor.rs
index e4a9ca9..30f1d56 100644
--- a/lightning/src/chain/chainmonitor.rs
+++ b/lightning/src/chain/chainmonitor.rs
@@ -262,12 +262,11 @@ pub struct AsyncPersister<
ES: EntropySource + MaybeSend + MaybeSync + 'static,
SP: Deref + MaybeSend + MaybeSync + 'static,
BI: BroadcasterInterface + MaybeSend + MaybeSync + 'static,
- FE: Deref + MaybeSend + MaybeSync + 'static,
+ FE: FeeEstimator + MaybeSend + MaybeSync + 'static,
> where
K::Target: KVStore + MaybeSync,
L::Target: Logger,
SP::Target: SignerProvider + Sized,
- FE::Target: FeeEstimator,
{
persister: MonitorUpdatingPersisterAsync<K, S, L, ES, SP, BI, FE>,
event_notifier: Arc<Notifier>,
@@ -280,13 +279,12 @@ impl<
ES: EntropySource + MaybeSend + MaybeSync + 'static,
SP: Deref + MaybeSend + MaybeSync + 'static,
BI: BroadcasterInterface + MaybeSend + MaybeSync + 'static,
- FE: Deref + MaybeSend + MaybeSync + 'static,
+ FE: FeeEstimator + MaybeSend + MaybeSync + 'static,
> Deref for AsyncPersister<K, S, L, ES, SP, BI, FE>
where
K::Target: KVStore + MaybeSync,
L::Target: Logger,
SP::Target: SignerProvider + Sized,
- FE::Target: FeeEstimator,
{
type Target = Self;
fn deref(&self) -> &Self {
@@ -301,13 +299,12 @@ impl<
ES: EntropySource + MaybeSend + MaybeSync + 'static,
SP: Deref + MaybeSend + MaybeSync + 'static,
BI: BroadcasterInterface + MaybeSend + MaybeSync + 'static,
- FE: Deref + MaybeSend + MaybeSync + 'static,
+ FE: FeeEstimator + MaybeSend + MaybeSync + 'static,
> Persist<<SP::Target as SignerProvider>::EcdsaSigner> for AsyncPersister<K, S, L, ES, SP, BI, FE>
where
K::Target: KVStore + MaybeSync,
L::Target: Logger,
SP::Target: SignerProvider + Sized,
- FE::Target: FeeEstimator,
<SP::Target as SignerProvider>::EcdsaSigner: MaybeSend + 'static,
{
fn persist_new_channel(
@@ -357,13 +354,12 @@ pub struct ChainMonitor<
ChannelSigner: EcdsaChannelSigner,
C: Deref,
T: BroadcasterInterface,
- F: Deref,
+ F: FeeEstimator,
L: Deref,
P: Deref,
ES: EntropySource,
> where
C::Target: chain::Filter,
- F::Target: FeeEstimator,
L::Target: Logger,
P::Target: Persist<ChannelSigner>,
{
@@ -397,7 +393,7 @@ impl<
SP: Deref + MaybeSend + MaybeSync + 'static,
C: Deref,
T: BroadcasterInterface + MaybeSend + MaybeSync + 'static,
- F: Deref + MaybeSend + MaybeSync + 'static,
+ F: FeeEstimator + MaybeSend + MaybeSync + 'static,
L: Deref + MaybeSend + MaybeSync + 'static,
ES: EntropySource + MaybeSend + MaybeSync + 'static,
>
@@ -413,7 +409,6 @@ impl<
K::Target: KVStore + MaybeSync,
SP::Target: SignerProvider + Sized,
C::Target: chain::Filter,
- F::Target: FeeEstimator,
L::Target: Logger,
<SP::Target as SignerProvider>::EcdsaSigner: MaybeSend + 'static,
{
@@ -453,14 +448,13 @@ impl<
ChannelSigner: EcdsaChannelSigner,
C: Deref,
T: BroadcasterInterface,
- F: Deref,
+ F: FeeEstimator,
L: Deref,
P: Deref,
ES: EntropySource,
> ChainMonitor<ChannelSigner, C, T, F, L, P, ES>
where
C::Target: chain::Filter,
- F::Target: FeeEstimator,
L::Target: Logger,
P::Target: Persist<ChannelSigner>,
{
@@ -884,7 +878,7 @@ where
for (_, monitor_holder) in &*monitors {
monitor_holder.monitor.rebroadcast_pending_claims(
&self.broadcaster,
- &*self.fee_estimator,
+ &self.fee_estimator,
&self.logger,
)
}
@@ -900,7 +894,7 @@ where
if let Some(monitor_holder) = monitors.get(&channel_id) {
monitor_holder.monitor.signer_unblocked(
&self.broadcaster,
- &*self.fee_estimator,
+ &self.fee_estimator,
&self.logger,
)
}
@@ -908,7 +902,7 @@ where
for (_, monitor_holder) in &*monitors {
monitor_holder.monitor.signer_unblocked(
&self.broadcaster,
- &*self.fee_estimator,
+ &self.fee_estimator,
&self.logger,
)
}
@@ -1098,14 +1092,13 @@ impl<
ChannelSigner: EcdsaChannelSigner,
C: Deref,
T: BroadcasterInterface,
- F: Deref,
+ F: FeeEstimator,
L: Deref,
P: Deref,
ES: EntropySource,
> BaseMessageHandler for ChainMonitor<ChannelSigner, C, T, F, L, P, ES>
where
C::Target: chain::Filter,
- F::Target: FeeEstimator,
L::Target: Logger,
P::Target: Persist<ChannelSigner>,
{
@@ -1135,14 +1128,13 @@ impl<
ChannelSigner: EcdsaChannelSigner,
C: Deref,
T: BroadcasterInterface,
- F: Deref,
+ F: FeeEstimator,
L: Deref,
P: Deref,
ES: EntropySource,
> SendOnlyMessageHandler for ChainMonitor<ChannelSigner, C, T, F, L, P, ES>
where
C::Target: chain::Filter,
- F::Target: FeeEstimator,
L::Target: Logger,
P::Target: Persist<ChannelSigner>,
{
@@ -1152,14 +1144,13 @@ impl<
ChannelSigner: EcdsaChannelSigner,
C: Deref,
T: BroadcasterInterface,
- F: Deref,
+ F: FeeEstimator,
L: Deref,
P: Deref,
ES: EntropySource,
> chain::Listen for ChainMonitor<ChannelSigner, C, T, F, L, P, ES>
where
C::Target: chain::Filter,
- F::Target: FeeEstimator,
L::Target: Logger,
P::Target: Persist<ChannelSigner>,
{
@@ -1176,7 +1167,7 @@ where
txdata,
height,
&self.broadcaster,
- &*self.fee_estimator,
+ &self.fee_estimator,
&self.logger,
)
});
@@ -1203,7 +1194,7 @@ where
monitor_state.monitor.blocks_disconnected(
fork_point,
&self.broadcaster,
- &*self.fee_estimator,
+ &self.fee_estimator,
&self.logger,
);
}
@@ -1214,14 +1205,13 @@ impl<
ChannelSigner: EcdsaChannelSigner,
C: Deref,
T: BroadcasterInterface,
- F: Deref,
+ F: FeeEstimator,
L: Deref,
P: Deref,
ES: EntropySource,
> chain::Confirm for ChainMonitor<ChannelSigner, C, T, F, L, P, ES>
where
C::Target: chain::Filter,
- F::Target: FeeEstimator,
L::Target: Logger,
P::Target: Persist<ChannelSigner>,
{
@@ -1239,7 +1229,7 @@ where
txdata,
height,
&self.broadcaster,
- &*self.fee_estimator,
+ &self.fee_estimator,
&self.logger,
)
});
@@ -1254,7 +1244,7 @@ where
monitor_state.monitor.transaction_unconfirmed(
txid,
&self.broadcaster,
- &*self.fee_estimator,
+ &self.fee_estimator,
&self.logger,
);
}
@@ -1275,7 +1265,7 @@ where
header,
height,
&self.broadcaster,
- &*self.fee_estimator,
+ &self.fee_estimator,
&self.logger,
)
});
@@ -1307,14 +1297,13 @@ impl<
ChannelSigner: EcdsaChannelSigner,
C: Deref,
T: BroadcasterInterface,
- F: Deref,
+ F: FeeEstimator,
L: Deref,
P: Deref,
ES: EntropySource,
> chain::Watch<ChannelSigner> for ChainMonitor<ChannelSigner, C, T, F, L, P, ES>
where
C::Target: chain::Filter,
- F::Target: FeeEstimator,
L::Target: Logger,
P::Target: Persist<ChannelSigner>,
{
@@ -1501,14 +1490,13 @@ impl<
ChannelSigner: EcdsaChannelSigner,
C: Deref,
T: BroadcasterInterface,
- F: Deref,
+ F: FeeEstimator,
L: Deref,
P: Deref,
ES: EntropySource,
> events::EventsProvider for ChainMonitor<ChannelSigner, C, T, F, L, P, ES>
where
C::Target: chain::Filter,
- F::Target: FeeEstimator,
L::Target: Logger,
P::Target: Persist<ChannelSigner>,
{
diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs
index 5c531cd..aa862ca 100644
--- a/lightning/src/chain/channelmonitor.rs
+++ b/lightning/src/chain/channelmonitor.rs
@@ -2058,7 +2058,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
///
/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
#[rustfmt::skip]
- pub(crate) fn provide_payment_preimage_unsafe_legacy<B: BroadcasterInterface, F: Deref, L: Deref>(
+ pub(crate) fn provide_payment_preimage_unsafe_legacy<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&self,
payment_hash: &PaymentHash,
payment_preimage: &PaymentPreimage,
@@ -2066,7 +2066,6 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
fee_estimator: &LowerBoundedFeeEstimator<F>,
logger: &L,
) where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let mut inner = self.inner.lock().unwrap();
@@ -2082,11 +2081,10 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
/// itself.
///
/// panics if the given update is not the next update by update_id.
- pub fn update_monitor<B: BroadcasterInterface, F: Deref, L: Deref>(
+ pub fn update_monitor<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&self, updates: &ChannelMonitorUpdate, broadcaster: &B, fee_estimator: &F, logger: &L,
) -> Result<(), ()>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let mut inner = self.inner.lock().unwrap();
@@ -2336,14 +2334,17 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
/// transactions that cannot be confirmed until the funding transaction is visible.
///
/// [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
- pub fn broadcast_latest_holder_commitment_txn<B: BroadcasterInterface, F: Deref, L: Deref>(
+ pub fn broadcast_latest_holder_commitment_txn<
+ B: BroadcasterInterface,
+ F: FeeEstimator,
+ L: Deref,
+ >(
&self, broadcaster: &B, fee_estimator: &F, logger: &L,
) where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let mut inner = self.inner.lock().unwrap();
- let fee_estimator = LowerBoundedFeeEstimator::new(&**fee_estimator);
+ let fee_estimator = LowerBoundedFeeEstimator::new(fee_estimator);
let logger = WithChannelMonitor::from_impl(logger, &*inner, None);
inner.queue_latest_holder_commitment_txn_for_broadcast(
@@ -2379,7 +2380,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
///
/// [`get_outputs_to_watch`]: #method.get_outputs_to_watch
#[rustfmt::skip]
- pub fn block_connected<B: BroadcasterInterface, F: Deref, L: Deref>(
+ pub fn block_connected<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&self,
header: &Header,
txdata: &TransactionData,
@@ -2389,7 +2390,6 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
logger: &L,
) -> Vec<TransactionOutputs>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let mut inner = self.inner.lock().unwrap();
@@ -2400,10 +2400,9 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
/// Determines if the disconnected block contained any transactions of interest and updates
/// appropriately.
- pub fn blocks_disconnected<B: BroadcasterInterface, F: Deref, L: Deref>(
+ pub fn blocks_disconnected<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&self, fork_point: BestBlock, broadcaster: B, fee_estimator: F, logger: &L,
) where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let mut inner = self.inner.lock().unwrap();
@@ -2419,7 +2418,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
///
/// [`block_connected`]: Self::block_connected
#[rustfmt::skip]
- pub fn transactions_confirmed<B: BroadcasterInterface, F: Deref, L: Deref>(
+ pub fn transactions_confirmed<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&self,
header: &Header,
txdata: &TransactionData,
@@ -2429,7 +2428,6 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
logger: &L,
) -> Vec<TransactionOutputs>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let bounded_fee_estimator = LowerBoundedFeeEstimator::new(fee_estimator);
@@ -2446,14 +2444,13 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
///
/// [`blocks_disconnected`]: Self::blocks_disconnected
#[rustfmt::skip]
- pub fn transaction_unconfirmed<B: BroadcasterInterface, F: Deref, L: Deref>(
+ pub fn transaction_unconfirmed<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&self,
txid: &Txid,
broadcaster: B,
fee_estimator: F,
logger: &L,
) where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let bounded_fee_estimator = LowerBoundedFeeEstimator::new(fee_estimator);
@@ -2472,7 +2469,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
///
/// [`block_connected`]: Self::block_connected
#[rustfmt::skip]
- pub fn best_block_updated<B: BroadcasterInterface, F: Deref, L: Deref>(
+ pub fn best_block_updated<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&self,
header: &Header,
height: u32,
@@ -2481,7 +2478,6 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
logger: &L,
) -> Vec<TransactionOutputs>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let bounded_fee_estimator = LowerBoundedFeeEstimator::new(fee_estimator);
@@ -2518,11 +2514,10 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
/// invoking this every 30 seconds, or lower if running in an environment with spotty
/// connections, like on mobile.
#[rustfmt::skip]
- pub fn rebroadcast_pending_claims<B: BroadcasterInterface, F: Deref, L: Deref>(
+ pub fn rebroadcast_pending_claims<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&self, broadcaster: B, fee_estimator: F, logger: &L,
)
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let fee_estimator = LowerBoundedFeeEstimator::new(fee_estimator);
@@ -2545,11 +2540,10 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
/// Triggers rebroadcasts of pending claims from a force-closed channel after a transaction
/// signature generation failure.
#[rustfmt::skip]
- pub fn signer_unblocked<B: BroadcasterInterface, F: Deref, L: Deref>(
+ pub fn signer_unblocked<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&self, broadcaster: B, fee_estimator: F, logger: &L,
)
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let fee_estimator = LowerBoundedFeeEstimator::new(fee_estimator);
@@ -3798,13 +3792,11 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
///
/// Note that this is often called multiple times for the same payment and must be idempotent.
#[rustfmt::skip]
- fn provide_payment_preimage<B: BroadcasterInterface, F: Deref, L: Deref>(
+ fn provide_payment_preimage<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&mut self, payment_hash: &PaymentHash, payment_preimage: &PaymentPreimage,
payment_info: &Option<PaymentClaimDetails>, broadcaster: &B,
- fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &WithContext<L>)
- where F::Target: FeeEstimator,
- L::Target: Logger,
- {
+ fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &WithContext<L>
+ ) where L::Target: Logger {
self.payment_preimages.entry(payment_hash.clone())
.and_modify(|(_, payment_infos)| {
if let Some(payment_info) = payment_info {
@@ -3976,12 +3968,11 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
/// See also [`ChannelMonitor::broadcast_latest_holder_commitment_txn`].
///
/// [`ChannelMonitor::broadcast_latest_holder_commitment_txn`]: crate::chain::channelmonitor::ChannelMonitor::broadcast_latest_holder_commitment_txn
- pub(crate) fn queue_latest_holder_commitment_txn_for_broadcast<B: BroadcasterInterface, F: Deref, L: Deref>(
+ pub(crate) fn queue_latest_holder_commitment_txn_for_broadcast<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&mut self, broadcaster: &B, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &WithContext<L>,
require_funding_seen: bool,
)
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let reason = ClosureReason::HolderForceClosed {
@@ -4178,11 +4169,10 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
}
#[rustfmt::skip]
- fn update_monitor<B: BroadcasterInterface, F: Deref, L: Deref>(
+ fn update_monitor<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&mut self, updates: &ChannelMonitorUpdate, broadcaster: &B, fee_estimator: &F, logger: &WithContext<L>
) -> Result<(), ()>
- where F::Target: FeeEstimator,
- L::Target: Logger,
+ where L::Target: Logger,
{
if self.latest_update_id == LEGACY_CLOSED_CHANNEL_UPDATE_ID && updates.update_id == LEGACY_CLOSED_CHANNEL_UPDATE_ID {
log_info!(logger, "Applying pre-0.1 post-force-closed update to monitor {} with {} change(s).",
@@ -4224,7 +4214,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
}
}
let mut ret = Ok(());
- let bounded_fee_estimator = LowerBoundedFeeEstimator::new(&**fee_estimator);
+ let bounded_fee_estimator = LowerBoundedFeeEstimator::new(fee_estimator);
for update in updates.updates.iter() {
match update {
ChannelMonitorUpdateStep::LatestHolderCommitmentTXInfo { commitment_tx, htlc_outputs, claimed_htlcs, nondust_htlc_sources } => {
@@ -5273,13 +5263,10 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
}
#[rustfmt::skip]
- fn block_connected<B: BroadcasterInterface, F: Deref, L: Deref>(
+ fn block_connected<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&mut self, header: &Header, txdata: &TransactionData, height: u32, broadcaster: B,
fee_estimator: F, logger: &WithContext<L>,
- ) -> Vec<TransactionOutputs>
- where F::Target: FeeEstimator,
- L::Target: Logger,
- {
+ ) -> Vec<TransactionOutputs> where L::Target: Logger, {
let block_hash = header.block_hash();
self.best_block = BestBlock::new(block_hash, height);
@@ -5288,7 +5275,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
}
#[rustfmt::skip]
- fn best_block_updated<B: BroadcasterInterface, F: Deref, L: Deref>(
+ fn best_block_updated<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&mut self,
header: &Header,
height: u32,
@@ -5297,7 +5284,6 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
logger: &WithContext<L>,
) -> Vec<TransactionOutputs>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let block_hash = header.block_hash();
@@ -5319,7 +5305,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
}
#[rustfmt::skip]
- fn transactions_confirmed<B: BroadcasterInterface, F: Deref, L: Deref>(
+ fn transactions_confirmed<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&mut self,
header: &Header,
txdata: &TransactionData,
@@ -5329,7 +5315,6 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
logger: &WithContext<L>,
) -> Vec<TransactionOutputs>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let funding_seen_before = self.funding_seen_onchain;
@@ -5603,7 +5588,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
/// `conf_height` should be set to the height at which any new transaction(s)/block(s) were
/// confirmed at, even if it is not the current best height.
#[rustfmt::skip]
- fn block_confirmed<B: BroadcasterInterface, F: Deref, L: Deref>(
+ fn block_confirmed<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&mut self,
conf_height: u32,
conf_hash: BlockHash,
@@ -5615,7 +5600,6 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
logger: &WithContext<L>,
) -> Vec<TransactionOutputs>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
log_trace!(logger, "Processing {} matched transactions for block at height {}.", txn_matched.len(), conf_height);
@@ -5830,10 +5814,9 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
}
#[rustfmt::skip]
- fn blocks_disconnected<B: BroadcasterInterface, F: Deref, L: Deref>(
+ fn blocks_disconnected<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&mut self, fork_point: BestBlock, broadcaster: B, fee_estimator: F, logger: &WithContext<L>
- ) where F::Target: FeeEstimator,
- L::Target: Logger,
+ ) where L::Target: Logger,
{
let new_height = fork_point.height;
log_trace!(logger, "Block(s) disconnected to height {}", new_height);
@@ -5878,14 +5861,13 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
}
#[rustfmt::skip]
- fn transaction_unconfirmed<B: BroadcasterInterface, F: Deref, L: Deref>(
+ fn transaction_unconfirmed<B: BroadcasterInterface, F: FeeEstimator, L: Deref>(
&mut self,
txid: &Txid,
broadcaster: B,
fee_estimator: &LowerBoundedFeeEstimator<F>,
logger: &WithContext<L>,
) where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let mut removed_height = None;
@@ -6338,38 +6320,36 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
}
}
-impl<Signer: EcdsaChannelSigner, T: BroadcasterInterface, F: Deref, L: Deref> chain::Listen
+impl<Signer: EcdsaChannelSigner, T: BroadcasterInterface, F: FeeEstimator, L: Deref> chain::Listen
for (ChannelMonitor<Signer>, T, F, L)
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
fn filtered_block_connected(&self, header: &Header, txdata: &TransactionData, height: u32) {
- self.0.block_connected(header, txdata, height, &self.1, &*self.2, &self.3);
+ self.0.block_connected(header, txdata, height, &self.1, &self.2, &self.3);
}
fn blocks_disconnected(&self, fork_point: BestBlock) {
- self.0.blocks_disconnected(fork_point, &self.1, &*self.2, &self.3);
+ self.0.blocks_disconnected(fork_point, &self.1, &self.2, &self.3);
}
}
-impl<Signer: EcdsaChannelSigner, M, T: BroadcasterInterface, F: Deref, L: Deref> chain::Confirm
- for (M, T, F, L)
+impl<Signer: EcdsaChannelSigner, M, T: BroadcasterInterface, F: FeeEstimator, L: Deref>
+ chain::Confirm for (M, T, F, L)
where
M: Deref<Target = ChannelMonitor<Signer>>,
- F::Target: FeeEstimator,
L::Target: Logger,
{
fn transactions_confirmed(&self, header: &Header, txdata: &TransactionData, height: u32) {
- self.0.transactions_confirmed(header, txdata, height, &self.1, &*self.2, &self.3);
+ self.0.transactions_confirmed(header, txdata, height, &self.1, &self.2, &self.3);
}
fn transaction_unconfirmed(&self, txid: &Txid) {
- self.0.transaction_unconfirmed(txid, &self.1, &*self.2, &self.3);
+ self.0.transaction_unconfirmed(txid, &self.1, &self.2, &self.3);
}
fn best_block_updated(&self, header: &Header, height: u32) {
- self.0.best_block_updated(header, height, &self.1, &*self.2, &self.3);
+ self.0.best_block_updated(header, height, &self.1, &self.2, &self.3);
}
fn get_relevant_txids(&self) -> Vec<(Txid, u32, Option<BlockHash>)> {
diff --git a/lightning/src/chain/onchaintx.rs b/lightning/src/chain/onchaintx.rs
index 321b600..cfee63b 100644
--- a/lightning/src/chain/onchaintx.rs
+++ b/lightning/src/chain/onchaintx.rs
@@ -45,7 +45,6 @@ use alloc::collections::BTreeMap;
use core::cmp;
use core::mem::replace;
use core::mem::swap;
-use core::ops::Deref;
const MAX_ALLOC_SIZE: usize = 64 * 1024;
@@ -485,14 +484,11 @@ impl<ChannelSigner: EcdsaChannelSigner> OnchainTxHandler<ChannelSigner> {
/// invoking this every 30 seconds, or lower if running in an environment with spotty
/// connections, like on mobile.
#[rustfmt::skip]
- pub(super) fn rebroadcast_pending_claims<B: BroadcasterInterface, F: Deref, L: Logger>(
+ pub(super) fn rebroadcast_pending_claims<B: BroadcasterInterface, F: FeeEstimator, L: Logger>(
&mut self, current_height: u32, feerate_strategy: FeerateStrategy, broadcaster: &B,
conf_target: ConfirmationTarget, destination_script: &Script,
fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
- )
- where
- F::Target: FeeEstimator,
- {
+ ) {
let mut bump_requests = Vec::with_capacity(self.pending_claim_requests.len());
for (claim_id, request) in self.pending_claim_requests.iter() {
let inputs = request.outpoints();
@@ -553,13 +549,11 @@ impl<ChannelSigner: EcdsaChannelSigner> OnchainTxHandler<ChannelSigner> {
/// Panics if there are signing errors, because signing operations in reaction to on-chain
/// events are not expected to fail, and if they do, we may lose funds.
#[rustfmt::skip]
- fn generate_claim<F: Deref, L: Logger>(
+ fn generate_claim<F: FeeEstimator, L: Logger>(
&mut self, cur_height: u32, cached_request: &PackageTemplate,
feerate_strategy: &FeerateStrategy, conf_target: ConfirmationTarget,
destination_script: &Script, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
- ) -> Option<(u32, u64, OnchainClaim)>
- where F::Target: FeeEstimator,
- {
+ ) -> Option<(u32, u64, OnchainClaim)> {
let request_outpoints = cached_request.outpoints();
if request_outpoints.is_empty() {
// Don't prune pending claiming request yet, we may have to resurrect HTLCs. Untractable
@@ -760,11 +754,11 @@ impl<ChannelSigner: EcdsaChannelSigner> OnchainTxHandler<ChannelSigner> {
/// does not need to equal the current blockchain tip height, which should be provided via
/// `cur_height`, however it must never be higher than `cur_height`.
#[rustfmt::skip]
- pub(super) fn update_claims_view_from_requests<B: BroadcasterInterface, F: Deref, L: Logger>(
+ pub(super) fn update_claims_view_from_requests<B: BroadcasterInterface, F: FeeEstimator, L: Logger>(
&mut self, mut requests: Vec<PackageTemplate>, conf_height: u32, cur_height: u32,
broadcaster: &B, conf_target: ConfirmationTarget, destination_script: &Script,
- fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L
- ) where F::Target: FeeEstimator, {
+ fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
+ ) {
if !requests.is_empty() {
log_debug!(logger, "Updating claims view at height {} with {} claim requests", cur_height, requests.len());
}
@@ -908,13 +902,11 @@ impl<ChannelSigner: EcdsaChannelSigner> OnchainTxHandler<ChannelSigner> {
/// confirmed. This does not need to equal the current blockchain tip height, which should be
/// provided via `cur_height`, however it must never be higher than `cur_height`.
#[rustfmt::skip]
- pub(super) fn update_claims_view_from_matched_txn<B: BroadcasterInterface, F: Deref, L: Logger>(
+ pub(super) fn update_claims_view_from_matched_txn<B: BroadcasterInterface, F: FeeEstimator, L: Logger>(
&mut self, txn_matched: &[&Transaction], conf_height: u32, conf_hash: BlockHash,
cur_height: u32, broadcaster: &B, conf_target: ConfirmationTarget,
- destination_script: &Script, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L
- ) where
- F::Target: FeeEstimator,
- {
+ destination_script: &Script, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
+ ) {
let mut have_logged_intro = false;
let mut maybe_log_intro = || {
if !have_logged_intro {
@@ -1105,7 +1097,7 @@ impl<ChannelSigner: EcdsaChannelSigner> OnchainTxHandler<ChannelSigner> {
}
#[rustfmt::skip]
- pub(super) fn transaction_unconfirmed<B: BroadcasterInterface, F: Deref, L: Logger>(
+ pub(super) fn transaction_unconfirmed<B: BroadcasterInterface, F: FeeEstimator, L: Logger>(
&mut self,
txid: &Txid,
broadcaster: &B,
@@ -1113,9 +1105,7 @@ impl<ChannelSigner: EcdsaChannelSigner> OnchainTxHandler<ChannelSigner> {
destination_script: &Script,
fee_estimator: &LowerBoundedFeeEstimator<F>,
logger: &L,
- ) where
- F::Target: FeeEstimator,
- {
+ ) {
let mut height = None;
for entry in self.onchain_events_awaiting_threshold_conf.iter() {
if entry.txid == *txid {
@@ -1132,10 +1122,10 @@ impl<ChannelSigner: EcdsaChannelSigner> OnchainTxHandler<ChannelSigner> {
}
#[rustfmt::skip]
- pub(super) fn blocks_disconnected<B: BroadcasterInterface, F: Deref, L: Logger>(
+ pub(super) fn blocks_disconnected<B: BroadcasterInterface, F: FeeEstimator, L: Logger>(
&mut self, new_best_height: u32, broadcaster: &B, conf_target: ConfirmationTarget,
destination_script: &Script, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
- ) where F::Target: FeeEstimator, {
+ ) {
let mut bump_candidates = new_hash_map();
let onchain_events_awaiting_threshold_conf =
self.onchain_events_awaiting_threshold_conf.drain(..).collect::<Vec<_>>();
diff --git a/lightning/src/chain/package.rs b/lightning/src/chain/package.rs
index db46f3b..0abe353 100644
--- a/lightning/src/chain/package.rs
+++ b/lightning/src/chain/package.rs
@@ -46,7 +46,6 @@ use crate::util::ser::{Readable, ReadableArgs, RequiredWrapper, Writeable, Write
use crate::io;
use core::cmp;
-use core::ops::Deref;
#[allow(unused_imports)]
use crate::prelude::*;
@@ -1512,12 +1511,10 @@ impl PackageTemplate {
/// which was used to generate the value. Will not return less than `dust_limit_sats` for the
/// value.
#[rustfmt::skip]
- pub(crate) fn compute_package_output<F: Deref, L: Logger>(
+ pub(crate) fn compute_package_output<F: FeeEstimator, L: Logger>(
&self, predicted_weight: u64, dust_limit_sats: u64, feerate_strategy: &FeerateStrategy,
conf_target: ConfirmationTarget, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
- ) -> Option<(u64, u64)>
- where F::Target: FeeEstimator,
- {
+ ) -> Option<(u64, u64)> {
debug_assert!(matches!(self.malleability, PackageMalleability::Malleable(..)),
"The package output is fixed for non-malleable packages");
let input_amounts = self.package_amount();
@@ -1540,10 +1537,10 @@ impl PackageTemplate {
/// Computes a feerate based on the given confirmation target and feerate strategy.
#[rustfmt::skip]
- pub(crate) fn compute_package_feerate<F: Deref>(
+ pub(crate) fn compute_package_feerate<F: FeeEstimator>(
&self, fee_estimator: &LowerBoundedFeeEstimator<F>, conf_target: ConfirmationTarget,
feerate_strategy: &FeerateStrategy,
- ) -> u32 where F::Target: FeeEstimator {
+ ) -> u32 {
let feerate_estimate = fee_estimator.bounded_sat_per_1000_weight(conf_target);
if self.feerate_previous != 0 {
let previous_feerate = self.feerate_previous.try_into().unwrap_or(u32::max_value());
@@ -1675,11 +1672,9 @@ impl Readable for PackageTemplate {
/// fee and the corresponding updated feerate. If fee is under [`FEERATE_FLOOR_SATS_PER_KW`],
/// we return nothing.
#[rustfmt::skip]
-fn compute_fee_from_spent_amounts<F: Deref, L: Logger>(
+fn compute_fee_from_spent_amounts<F: FeeEstimator, L: Logger>(
input_amounts: u64, predicted_weight: u64, conf_target: ConfirmationTarget, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L
-) -> Option<(u64, u64)>
- where F::Target: FeeEstimator,
-{
+) -> Option<(u64, u64)> {
let sweep_feerate = fee_estimator.bounded_sat_per_1000_weight(conf_target);
let fee_rate = cmp::min(sweep_feerate, compute_feerate_sat_per_1000_weight(input_amounts / 2, predicted_weight));
let fee = fee_rate as u64 * (predicted_weight) / 1000;
@@ -1701,14 +1696,11 @@ fn compute_fee_from_spent_amounts<F: Deref, L: Logger>(
/// respect BIP125 rules 3) and 4) and if required adjust the new fee to meet the RBF policy
/// requirement.
#[rustfmt::skip]
-fn feerate_bump<F: Deref, L: Logger>(
+fn feerate_bump<F: FeeEstimator, L: Logger>(
predicted_weight: u64, input_amounts: u64, dust_limit_sats: u64, previous_feerate: u64,
feerate_strategy: &FeerateStrategy, conf_target: ConfirmationTarget,
fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
-) -> Option<(u64, u64)>
-where
- F::Target: FeeEstimator,
-{
+) -> Option<(u64, u64)> {
let previous_fee = previous_feerate * predicted_weight / 1000;
// If old feerate inferior to actual one given back by Fee Estimator, use it to compute new fee...
diff --git a/lightning/src/ln/chan_utils.rs b/lightning/src/ln/chan_utils.rs
index 46afa05..4bb8ffa 100644
--- a/lightning/src/ln/chan_utils.rs
+++ b/lightning/src/ln/chan_utils.rs
@@ -320,12 +320,9 @@ pub(crate) fn htlc_tx_fees_sat(feerate_per_kw: u32, num_accepted_htlcs: usize, n
/// Returns a fee estimate for the commitment transaction that we would ideally like to set,
/// depending on channel type.
-pub(super) fn selected_commitment_sat_per_1000_weight<F: Deref>(
+pub(super) fn selected_commitment_sat_per_1000_weight<F: FeeEstimator>(
fee_estimator: &LowerBoundedFeeEstimator<F>, channel_type: &ChannelTypeFeatures,
-) -> u32
-where
- F::Target: FeeEstimator,
-{
+) -> u32 {
if channel_type.supports_anchor_zero_fee_commitments() {
0
} else if channel_type.supports_anchors_zero_fee_htlc_tx() {
diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs
index 31c3996..56317e7 100644
--- a/lightning/src/ln/channel.rs
+++ b/lightning/src/ln/channel.rs
@@ -1757,12 +1757,11 @@ where
}
#[rustfmt::skip]
- pub fn maybe_handle_error_without_close<F: Deref, L: Deref>(
+ pub fn maybe_handle_error_without_close<F: FeeEstimator, L: Deref>(
&mut self, chain_hash: ChainHash, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
user_config: &UserConfig, their_features: &InitFeatures,
) -> Result<Option<OpenChannelMessage>, ()>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
match &mut self.phase {
@@ -1902,11 +1901,10 @@ where
}
}
- pub fn tx_complete<F: Deref, L: Deref>(
+ pub fn tx_complete<F: FeeEstimator, L: Deref>(
&mut self, msg: &msgs::TxComplete, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
) -> Result<TxCompleteResult, (ChannelError, Option<SpliceFundingFailed>)>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let tx_complete_action = match self.interactive_tx_constructor_mut() {
@@ -2144,12 +2142,11 @@ where
Ok(())
}
- pub fn funding_transaction_signed<F: Deref, L: Deref>(
+ pub fn funding_transaction_signed<F: FeeEstimator, L: Deref>(
&mut self, funding_txid_signed: Txid, witnesses: Vec<Witness>, best_block_height: u32,
fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
) -> Result<FundingTxSigned, APIError>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let (context, funding, pending_splice) = match &mut self.phase {
@@ -2322,11 +2319,10 @@ where
}
#[rustfmt::skip]
- pub fn commitment_signed<F: Deref, L: Deref>(
+ pub fn commitment_signed<F: FeeEstimator, L: Deref>(
&mut self, msg: &msgs::CommitmentSigned, best_block: BestBlock, signer_provider: &SP, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L
) -> Result<(Option<ChannelMonitor<<SP::Target as SignerProvider>::EcdsaSigner>>, Option<ChannelMonitorUpdate>), ChannelError>
where
- F::Target: FeeEstimator,
L::Target: Logger
{
let phase = core::mem::replace(&mut self.phase, ChannelPhase::Undefined);
@@ -2424,12 +2420,9 @@ where
/// Doesn't bother handling the
/// if-we-removed-it-already-but-haven't-fully-resolved-they-can-still-send-an-inbound-HTLC
/// corner case properly.
- pub fn get_available_balances<F: Deref>(
+ pub fn get_available_balances<F: FeeEstimator>(
&self, fee_estimator: &LowerBoundedFeeEstimator<F>,
- ) -> AvailableBalances
- where
- F::Target: FeeEstimator,
- {
+ ) -> AvailableBalances {
match &self.phase {
ChannelPhase::Undefined => unreachable!(),
ChannelPhase::Funded(chan) => chan.get_available_balances(fee_estimator),
@@ -3567,7 +3560,7 @@ where
SP::Target: SignerProvider,
{
#[rustfmt::skip]
- fn new_for_inbound_channel<'a, ES: EntropySource, F: Deref, L: Deref>(
+ fn new_for_inbound_channel<'a, ES: EntropySource, F: FeeEstimator, L: Deref>(
fee_estimator: &'a LowerBoundedFeeEstimator<F>,
entropy_source: &'a ES,
signer_provider: &'a SP,
@@ -3587,7 +3580,6 @@ where
open_channel_fields: msgs::CommonOpenChannelFields,
) -> Result<(FundingScope, ChannelContext<SP>), ChannelError>
where
- F::Target: FeeEstimator,
L::Target: Logger,
SP::Target: SignerProvider,
{
@@ -3911,7 +3903,7 @@ where
}
#[rustfmt::skip]
- fn new_for_outbound_channel<'a, ES: EntropySource, F: Deref, L: Deref>(
+ fn new_for_outbound_channel<'a, ES: EntropySource, F: FeeEstimator, L: Deref>(
fee_estimator: &'a LowerBoundedFeeEstimator<F>,
entropy_source: &'a ES,
signer_provider: &'a SP,
@@ -3930,7 +3922,6 @@ where
_logger: L,
) -> Result<(FundingScope, ChannelContext<SP>), APIError>
where
- F::Target: FeeEstimator,
SP::Target: SignerProvider,
L::Target: Logger,
{
@@ -4541,12 +4532,9 @@ where
/// Returns a maximum "sane" fee rate used to reason about our dust exposure.
/// Will be Some if the `channel_type`'s dust exposure depends on its commitment fee rate, and
/// None otherwise.
- fn get_dust_exposure_limiting_feerate<F: Deref>(
+ fn get_dust_exposure_limiting_feerate<F: FeeEstimator>(
&self, fee_estimator: &LowerBoundedFeeEstimator<F>, channel_type: &ChannelTypeFeatures,
- ) -> Option<u32>
- where
- F::Target: FeeEstimator,
- {
+ ) -> Option<u32> {
if channel_type.supports_anchor_zero_fee_commitments() {
None
} else {
@@ -4943,13 +4931,10 @@ where
Ok(ret)
}
- fn validate_update_add_htlc<F: Deref>(
+ fn validate_update_add_htlc<F: FeeEstimator>(
&self, funding: &FundingScope, msg: &msgs::UpdateAddHTLC,
fee_estimator: &LowerBoundedFeeEstimator<F>,
- ) -> Result<(), ChannelError>
- where
- F::Target: FeeEstimator,
- {
+ ) -> Result<(), ChannelError> {
if msg.amount_msat > funding.get_value_satoshis() * 1000 {
return Err(ChannelError::close(
"Remote side tried to send more than the total value of the channel".to_owned(),
@@ -5061,13 +5046,10 @@ where
Ok(())
}
- fn validate_update_fee<F: Deref>(
+ fn validate_update_fee<F: FeeEstimator>(
&self, funding: &FundingScope, fee_estimator: &LowerBoundedFeeEstimator<F>,
new_feerate_per_kw: u32,
- ) -> Result<(), ChannelError>
- where
- F::Target: FeeEstimator,
- {
+ ) -> Result<(), ChannelError> {
// Check that we won't be pushed over our dust exposure limit by the feerate increase.
let dust_exposure_limiting_feerate =
self.get_dust_exposure_limiting_feerate(&fee_estimator, funding.get_channel_type());
@@ -5139,7 +5121,7 @@ where
Ok(())
}
- fn validate_commitment_signed<F: Deref, L: Deref>(
+ fn validate_commitment_signed<F: FeeEstimator, L: Deref>(
&self, funding: &FundingScope, transaction_number: u64, commitment_point: PublicKey,
msg: &msgs::CommitmentSigned, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
) -> Result<
@@ -5147,7 +5129,6 @@ where
ChannelError,
>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let funding_script = funding.get_funding_redeemscript();
@@ -5271,12 +5252,11 @@ where
Ok((holder_commitment_tx, commitment_data.htlcs_included))
}
- fn can_send_update_fee<F: Deref, L: Deref>(
+ fn can_send_update_fee<F: FeeEstimator, L: Deref>(
&self, funding: &FundingScope, feerate_per_kw: u32,
fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
) -> bool
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
// Before proposing a feerate update, check that we can actually afford the new fee.
@@ -5858,12 +5838,9 @@ where
}
#[rustfmt::skip]
- fn get_available_balances_for_scope<F: Deref>(
+ fn get_available_balances_for_scope<F: FeeEstimator>(
&self, funding: &FundingScope, fee_estimator: &LowerBoundedFeeEstimator<F>,
- ) -> AvailableBalances
- where
- F::Target: FeeEstimator,
- {
+ ) -> AvailableBalances {
let context = &self;
// Note that we have to handle overflow due to the case mentioned in the docs in general
// here.
@@ -6382,13 +6359,10 @@ where
/// of the channel type we tried, not of our ability to open any channel at all. We can see if a
/// downgrade of channel features would be possible so that we can still open the channel.
#[rustfmt::skip]
- pub(crate) fn maybe_downgrade_channel_features<F: Deref>(
+ pub(crate) fn maybe_downgrade_channel_features<F: FeeEstimator>(
&mut self, funding: &mut FundingScope, fee_estimator: &LowerBoundedFeeEstimator<F>,
user_config: &UserConfig, their_features: &InitFeatures,
- ) -> Result<(), ()>
- where
- F::Target: FeeEstimator
- {
+ ) -> Result<(), ()> {
if !funding.is_outbound() ||
!matches!(
self.channel_state, ChannelState::NegotiatingFunding(flags)
@@ -7332,11 +7306,10 @@ where
}
#[rustfmt::skip]
- fn check_remote_fee<F: Deref, L: Deref>(
+ fn check_remote_fee<F: FeeEstimator, L: Deref>(
channel_type: &ChannelTypeFeatures, fee_estimator: &LowerBoundedFeeEstimator<F>,
feerate_per_kw: u32, cur_feerate_per_kw: Option<u32>, logger: &L
- ) -> Result<(), ChannelError> where F::Target: FeeEstimator, L::Target: Logger,
- {
+ ) -> Result<(), ChannelError> where L::Target: Logger {
if channel_type.supports_anchor_zero_fee_commitments() {
if feerate_per_kw != 0 {
let err = "Zero Fee Channels must never attempt to use a fee".to_owned();
@@ -7942,9 +7915,9 @@ where
}
#[rustfmt::skip]
- pub fn update_add_htlc<F: Deref>(
+ pub fn update_add_htlc<F: FeeEstimator>(
&mut self, msg: &msgs::UpdateAddHTLC, fee_estimator: &LowerBoundedFeeEstimator<F>,
- ) -> Result<(), ChannelError> where F::Target: FeeEstimator {
+ ) -> Result<(), ChannelError> {
if self.context.channel_state.is_remote_stfu_sent() || self.context.channel_state.is_quiescent() {
return Err(ChannelError::WarnAndDisconnect("Got add HTLC message while quiescent".to_owned()));
}
@@ -8166,12 +8139,11 @@ where
/// Note that our `commitment_signed` send did not include a monitor update. This is due to:
/// 1. Updates cannot be made since the state machine is paused until `tx_signatures`.
/// 2. We're still able to abort negotiation until `tx_signatures`.
- fn splice_initial_commitment_signed<F: Deref, L: Deref>(
+ fn splice_initial_commitment_signed<F: FeeEstimator, L: Deref>(
&mut self, msg: &msgs::CommitmentSigned, fee_estimator: &LowerBoundedFeeEstimator<F>,
logger: &L,
) -> Result<Option<ChannelMonitorUpdate>, ChannelError>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
debug_assert!(self
@@ -8284,12 +8256,11 @@ where
(nondust_htlc_sources, dust_htlcs)
}
- pub fn commitment_signed<F: Deref, L: Deref>(
+ pub fn commitment_signed<F: FeeEstimator, L: Deref>(
&mut self, msg: &msgs::CommitmentSigned, fee_estimator: &LowerBoundedFeeEstimator<F>,
logger: &L,
) -> Result<Option<ChannelMonitorUpdate>, ChannelError>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
self.commitment_signed_check_state()?;
@@ -8328,12 +8299,11 @@ where
self.commitment_signed_update_monitor(update, logger)
}
- pub fn commitment_signed_batch<F: Deref, L: Deref>(
+ pub fn commitment_signed_batch<F: FeeEstimator, L: Deref>(
&mut self, batch: Vec<msgs::CommitmentSigned>, fee_estimator: &LowerBoundedFeeEstimator<F>,
logger: &L,
) -> Result<Option<ChannelMonitorUpdate>, ChannelError>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
self.commitment_signed_check_state()?;
@@ -8582,11 +8552,10 @@ where
/// Public version of the below, checking relevant preconditions first.
/// If we're not in a state where freeing the holding cell makes sense, this is a no-op and
/// returns `(None, Vec::new())`.
- pub fn maybe_free_holding_cell_htlcs<F: Deref, L: Deref>(
+ pub fn maybe_free_holding_cell_htlcs<F: FeeEstimator, L: Deref>(
&mut self, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
) -> (Option<ChannelMonitorUpdate>, Vec<(HTLCSource, PaymentHash)>)
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
if matches!(self.context.channel_state, ChannelState::ChannelReady(_))
@@ -8600,11 +8569,10 @@ where
/// Frees any pending commitment updates in the holding cell, generating the relevant messages
/// for our counterparty.
- fn free_holding_cell_htlcs<F: Deref, L: Deref>(
+ fn free_holding_cell_htlcs<F: FeeEstimator, L: Deref>(
&mut self, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
) -> (Option<ChannelMonitorUpdate>, Vec<(HTLCSource, PaymentHash)>)
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
assert!(matches!(self.context.channel_state, ChannelState::ChannelReady(_)));
@@ -8809,7 +8777,7 @@ where
///
/// [`HeldHtlcAvailable`]: crate::onion_message::async_payments::HeldHtlcAvailable
/// [`ReleaseHeldHtlc`]: crate::onion_message::async_payments::ReleaseHeldHtlc
- pub fn revoke_and_ack<F: Deref, L: Deref>(
+ pub fn revoke_and_ack<F: FeeEstimator, L: Deref>(
&mut self, msg: &msgs::RevokeAndACK, fee_estimator: &LowerBoundedFeeEstimator<F>,
logger: &L, hold_mon_update: bool,
) -> Result<
@@ -8821,7 +8789,6 @@ where
ChannelError,
>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
if self.context.channel_state.is_quiescent() {
@@ -9369,10 +9336,9 @@ where
/// Queues up an outbound update fee by placing it in the holding cell. You should call
/// [`Self::maybe_free_holding_cell_htlcs`] in order to actually generate and send the
/// commitment update.
- pub fn queue_update_fee<F: Deref, L: Deref>(
+ pub fn queue_update_fee<F: FeeEstimator, L: Deref>(
&mut self, feerate_per_kw: u32, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
) where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let msg_opt = self.send_update_fee(feerate_per_kw, true, fee_estimator, logger);
@@ -9387,12 +9353,10 @@ where
/// You MUST call [`Self::send_commitment_no_state_update`] prior to any other calls on this
/// [`FundedChannel`] if `force_holding_cell` is false.
#[rustfmt::skip]
- fn send_update_fee<F: Deref, L: Deref>(
+ fn send_update_fee<F: FeeEstimator, L: Deref>(
&mut self, feerate_per_kw: u32, mut force_holding_cell: bool,
fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L
- ) -> Option<msgs::UpdateFee>
- where F::Target: FeeEstimator, L::Target: Logger
- {
+ ) -> Option<msgs::UpdateFee> where L::Target: Logger {
if !self.funding.is_outbound() {
panic!("Cannot send fee from inbound channel");
}
@@ -9704,8 +9668,8 @@ where
}
#[rustfmt::skip]
- pub fn update_fee<F: Deref, L: Deref>(&mut self, fee_estimator: &LowerBoundedFeeEstimator<F>, msg: &msgs::UpdateFee, logger: &L) -> Result<(), ChannelError>
- where F::Target: FeeEstimator, L::Target: Logger
+ pub fn update_fee<F: FeeEstimator, L: Deref>(&mut self, fee_estimator: &LowerBoundedFeeEstimator<F>, msg: &msgs::UpdateFee, logger: &L) -> Result<(), ChannelError>
+ where L::Target: Logger
{
if self.funding.is_outbound() {
return Err(ChannelError::close("Non-funding remote tried to update channel fee".to_owned()));
@@ -10427,12 +10391,9 @@ where
/// Calculates and returns our minimum and maximum closing transaction fee amounts, in whole
/// satoshis. The amounts remain consistent unless a peer disconnects/reconnects or we restart,
/// at which point they will be recalculated.
- fn calculate_closing_fee_limits<F: Deref>(
+ fn calculate_closing_fee_limits<F: FeeEstimator>(
&mut self, fee_estimator: &LowerBoundedFeeEstimator<F>,
- ) -> (u64, u64)
- where
- F::Target: FeeEstimator,
- {
+ ) -> (u64, u64) {
if let Some((min, max)) = self.context.closing_fee_limits {
return (min, max);
}
@@ -10519,11 +10480,10 @@ where
Ok(())
}
- pub fn maybe_propose_closing_signed<F: Deref, L: Deref>(
+ pub fn maybe_propose_closing_signed<F: FeeEstimator, L: Deref>(
&mut self, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
) -> Result<(Option<msgs::ClosingSigned>, Option<(Transaction, ShutdownResult)>), ChannelError>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
// If we're waiting on a monitor persistence, that implies we're also waiting to send some
@@ -10846,12 +10806,11 @@ where
}
}
- pub fn closing_signed<F: Deref, L: Deref>(
+ pub fn closing_signed<F: FeeEstimator, L: Deref>(
&mut self, fee_estimator: &LowerBoundedFeeEstimator<F>, msg: &msgs::ClosingSigned,
logger: &L,
) -> Result<(Option<msgs::ClosingSigned>, Option<(Transaction, ShutdownResult)>), ChannelError>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
if self.is_shutdown_pending_signature() {
@@ -11096,13 +11055,9 @@ where
/// When this function is called, the HTLC is already irrevocably committed to the channel;
/// this function determines whether to fail the HTLC, or forward / claim it.
#[rustfmt::skip]
- pub fn can_accept_incoming_htlc<F: Deref, L: Deref>(
+ pub fn can_accept_incoming_htlc<F: FeeEstimator, L: Deref>(
&self, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: L
- ) -> Result<(), LocalHTLCFailureReason>
- where
- F::Target: FeeEstimator,
- L::Target: Logger
- {
+ ) -> Result<(), LocalHTLCFailureReason> where L::Target: Logger {
if self.context.channel_state.is_local_shutdown_sent() {
return Err(LocalHTLCFailureReason::ChannelClosed)
}
@@ -12780,14 +12735,13 @@ where
/// Queues up an outbound HTLC to send by placing it in the holding cell. You should call
/// [`Self::maybe_free_holding_cell_htlcs`] in order to actually generate and send the
/// commitment update.
- pub fn queue_add_htlc<F: Deref, L: Deref>(
+ pub fn queue_add_htlc<F: FeeEstimator, L: Deref>(
&mut self, amount_msat: u64, payment_hash: PaymentHash, cltv_expiry: u32,
source: HTLCSource, onion_routing_packet: msgs::OnionPacket, skimmed_fee_msat: Option<u64>,
blinding_point: Option<PublicKey>, accountable: bool,
fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
) -> Result<(), (LocalHTLCFailureReason, String)>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
self.send_htlc(
@@ -12829,14 +12783,13 @@ where
/// on this [`FundedChannel`] if `force_holding_cell` is false.
///
/// `Err`'s will always be temporary channel failures.
- fn send_htlc<F: Deref, L: Deref>(
+ fn send_htlc<F: FeeEstimator, L: Deref>(
&mut self, amount_msat: u64, payment_hash: PaymentHash, cltv_expiry: u32,
source: HTLCSource, onion_routing_packet: msgs::OnionPacket, mut force_holding_cell: bool,
skimmed_fee_msat: Option<u64>, blinding_point: Option<PublicKey>, hold_htlc: bool,
accountable: bool, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
) -> Result<bool, (LocalHTLCFailureReason, String)>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
if !matches!(self.context.channel_state, ChannelState::ChannelReady(_))
@@ -12946,12 +12899,9 @@ where
}
#[rustfmt::skip]
- pub(super) fn get_available_balances<F: Deref>(
+ pub(super) fn get_available_balances<F: FeeEstimator>(
&self, fee_estimator: &LowerBoundedFeeEstimator<F>,
- ) -> AvailableBalances
- where
- F::Target: FeeEstimator,
- {
+ ) -> AvailableBalances {
core::iter::once(&self.funding)
.chain(self.pending_funding().iter())
.map(|funding| self.context.get_available_balances_for_scope(funding, fee_estimator))
@@ -13185,14 +13135,13 @@ where
///
/// Shorthand for calling [`Self::send_htlc`] followed by a commitment update, see docs on
/// [`Self::send_htlc`] and [`Self::build_commitment_no_state_update`] for more info.
- pub fn send_htlc_and_commit<F: Deref, L: Deref>(
+ pub fn send_htlc_and_commit<F: FeeEstimator, L: Deref>(
&mut self, amount_msat: u64, payment_hash: PaymentHash, cltv_expiry: u32,
source: HTLCSource, onion_routing_packet: msgs::OnionPacket, skimmed_fee_msat: Option<u64>,
hold_htlc: bool, accountable: bool, fee_estimator: &LowerBoundedFeeEstimator<F>,
logger: &L,
) -> Result<Option<ChannelMonitorUpdate>, ChannelError>
where
- F::Target: FeeEstimator,
L::Target: Logger,
{
let send_res = self.send_htlc(
@@ -13690,14 +13639,11 @@ where
#[allow(dead_code)] // TODO(dual_funding): Remove once opending V2 channels is enabled.
#[rustfmt::skip]
- pub fn new<ES: EntropySource, F: Deref, L: Deref>(
+ pub fn new<ES: EntropySource, F: FeeEstimator, L: Deref>(
fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP, counterparty_node_id: PublicKey, their_features: &InitFeatures,
channel_value_satoshis: u64, push_msat: u64, user_id: u128, config: &UserConfig, current_chain_height: u32,
outbound_scid_alias: u64, temporary_channel_id: Option<ChannelId>, logger: L
- ) -> Result<OutboundV1Channel<SP>, APIError>
- where F::Target: FeeEstimator,
- L::Target: Logger,
- {
+ ) -> Result<OutboundV1Channel<SP>, APIError> where L::Target: Logger {
let holder_selected_channel_reserve_satoshis = get_holder_selected_channel_reserve_satoshis(channel_value_satoshis, config);
if holder_selected_channel_reserve_satoshis < MIN_CHAN_DUST_LIMIT_SATOSHIS {
// Protocol level safety check in place, although it should never happen because
@@ -13829,14 +13775,10 @@ where
/// not of our ability to open any channel at all. Thus, on error, we should first call this
/// and see if we get a new `OpenChannel` message, otherwise the channel is failed.
#[rustfmt::skip]
- pub(crate) fn maybe_handle_error_without_close<F: Deref, L: Deref>(
+ pub(crate) fn maybe_handle_error_without_close<F: FeeEstimator, L: Deref>(
&mut self, chain_hash: ChainHash, fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L,
user_config: &UserConfig, their_features: &InitFeatures,
- ) -> Result<msgs::OpenChannel, ()>
- where
- F::Target: FeeEstimator,
- L::Target: Logger,
- {
+ ) -> Result<msgs::OpenChannel, ()> where L::Target: Logger, {
self.context.maybe_downgrade_channel_features(
&mut self.funding, fee_estimator, user_config, their_features,
)?;
@@ -14081,15 +14023,12 @@ where
/// Creates a new channel from a remote sides' request for one.
/// Assumes chain_hash has already been checked and corresponds with what we expect!
#[rustfmt::skip]
- pub fn new<ES: EntropySource, F: Deref, L: Deref>(
+ pub fn new<ES: EntropySource, F: FeeEstimator, L: Deref>(
fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP,
counterparty_node_id: PublicKey, our_supported_features: &ChannelTypeFeatures,
their_features: &InitFeatures, msg: &msgs::OpenChannel, user_id: u128, config: &UserConfig,
current_chain_height: u32, logger: &L, is_0conf: bool,
- ) -> Result<InboundV1Channel<SP>, ChannelError>
- where F::Target: FeeEstimator,
- L::Target: Logger,
- {
+ ) -> Result<InboundV1Channel<SP>, ChannelError> where L::Target: Logger {
let logger = WithContext::from(logger, Some(counterparty_node_id), Some(msg.common_fields.temporary_channel_id), None);
// First check the channel type is known, failing before we do anything else if we don't
@@ -14354,16 +14293,13 @@ where
{
#[allow(dead_code)] // TODO(dual_funding): Remove once creating V2 channels is enabled.
#[rustfmt::skip]
- pub fn new_outbound<ES: EntropySource, F: Deref, L: Deref>(
+ pub fn new_outbound<ES: EntropySource, F: FeeEstimator, L: Deref>(
fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP,
counterparty_node_id: PublicKey, their_features: &InitFeatures, funding_satoshis: u64,
funding_inputs: Vec<FundingTxInput>, user_id: u128, config: &UserConfig,
current_chain_height: u32, outbound_scid_alias: u64, funding_confirmation_target: ConfirmationTarget,
logger: L,
- ) -> Result<Self, APIError>
- where F::Target: FeeEstimator,
- L::Target: Logger,
- {
+ ) -> Result<Self, APIError> where L::Target: Logger {
let channel_keys_id = signer_provider.generate_channel_keys_id(false, user_id);
let holder_signer = signer_provider.derive_channel_signer(channel_keys_id);
@@ -14426,13 +14362,10 @@ where
/// If we receive an error message, it may only be a rejection of the channel type we tried,
/// not of our ability to open any channel at all. Thus, on error, we should first call this
/// and see if we get a new `OpenChannelV2` message, otherwise the channel is failed.
- pub(crate) fn maybe_handle_error_without_close<F: Deref>(
+ pub(crate) fn maybe_handle_error_without_close<F: FeeEstimator>(
&mut self, chain_hash: ChainHash, fee_estimator: &LowerBoundedFeeEstimator<F>,
user_config: &UserConfig, their_features: &InitFeatures,
- ) -> Result<msgs::OpenChannelV2, ()>
- where
- F::Target: FeeEstimator,
- {
+ ) -> Result<msgs::OpenChannelV2, ()> {
self.context.maybe_downgrade_channel_features(
&mut self.funding,
fee_estimator,
@@ -14502,15 +14435,12 @@ where
/// TODO(dual_funding): Allow contributions, pass intended amount and inputs
#[allow(dead_code)] // TODO(dual_funding): Remove once V2 channels is enabled.
#[rustfmt::skip]
- pub fn new_inbound<ES: EntropySource, F: Deref, L: Deref>(
+ pub fn new_inbound<ES: EntropySource, F: FeeEstimator, L: Deref>(
fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP,
holder_node_id: PublicKey, counterparty_node_id: PublicKey, our_supported_features: &ChannelTypeFeatures,
their_features: &InitFeatures, msg: &msgs::OpenChannelV2,
user_id: u128, config: &UserConfig, current_chain_height: u32, logger: &L,
- ) -> Result<Self, ChannelError>
- where F::Target: FeeEstimator,
- L::Target: Logger,
- {
+ ) -> Result<Self, ChannelError> where L::Target: Logger, {
// TODO(dual_funding): Take these as input once supported
let (our_funding_contribution, our_funding_contribution_sats) = (SignedAmount::ZERO, 0u64);
let our_funding_inputs = Vec::new();
diff --git a/lightning/src/ln/channel_state.rs b/lightning/src/ln/channel_state.rs
index d10327b..7c591ff 100644
--- a/lightning/src/ln/channel_state.rs
+++ b/lightning/src/ln/channel_state.rs
@@ -524,13 +524,12 @@ impl ChannelDetails {
}
}
- pub(super) fn from_channel<SP: Deref, F: Deref>(
+ pub(super) fn from_channel<SP: Deref, F: FeeEstimator>(
channel: &Channel<SP>, best_block_height: u32, latest_features: InitFeatures,
fee_estimator: &LowerBoundedFeeEstimator<F>,
) -> Self
where
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
{
let context = channel.context();
let funding = channel.funding();
diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs
index 99adfb6..d7c6d86 100644
--- a/lightning/src/ln/channelmanager.rs
+++ b/lightning/src/ln/channelmanager.rs
@@ -1801,9 +1801,7 @@ pub trait AChannelManager {
/// A type that may be dereferenced to [`Self::SignerProvider`].
type SP: Deref<Target = Self::SignerProvider>;
/// A type implementing [`FeeEstimator`].
- type FeeEstimator: FeeEstimator + ?Sized;
- /// A type that may be dereferenced to [`Self::FeeEstimator`].
- type F: Deref<Target = Self::FeeEstimator>;
+ type FeeEstimator: FeeEstimator;
/// A type implementing [`Router`].
type Router: Router + ?Sized;
/// A type that may be dereferenced to [`Self::Router`].
@@ -1825,7 +1823,7 @@ pub trait AChannelManager {
Self::EntropySource,
Self::NodeSigner,
Self::SP,
- Self::F,
+ Self::FeeEstimator,
Self::R,
Self::MR,
Self::L,
@@ -1838,7 +1836,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -1846,7 +1844,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -1859,8 +1856,7 @@ where
type Signer = <SP::Target as SignerProvider>::EcdsaSigner;
type SignerProvider = SP::Target;
type SP = SP;
- type FeeEstimator = F::Target;
- type F = F;
+ type FeeEstimator = F;
type Router = R::Target;
type R = R;
type MessageRouter = MR::Target;
@@ -2617,14 +2613,13 @@ pub struct ChannelManager<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
> where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -3404,7 +3399,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -3412,7 +3407,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -13542,7 +13536,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -13550,7 +13544,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -14416,7 +14409,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -14424,7 +14417,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -14784,7 +14776,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -14792,7 +14784,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -14816,7 +14807,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -14824,7 +14815,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -14874,7 +14864,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -14882,7 +14872,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -15044,7 +15033,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -15052,7 +15041,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -15403,7 +15391,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -15411,7 +15399,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -15975,7 +15962,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -15983,7 +15970,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -16190,7 +16176,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -16198,7 +16184,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -16432,7 +16417,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -16440,7 +16425,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -16497,7 +16481,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -16505,7 +16489,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -17010,7 +16993,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref,
@@ -17018,7 +17001,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -17374,14 +17356,13 @@ pub struct ChannelManagerReadArgs<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref + Clone,
> where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -17451,7 +17432,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref + Clone,
@@ -17459,7 +17440,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -17536,7 +17516,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref + Clone,
@@ -17545,7 +17525,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
@@ -17566,7 +17545,7 @@ impl<
ES: EntropySource,
NS: NodeSigner,
SP: Deref,
- F: Deref,
+ F: FeeEstimator,
R: Deref,
MR: Deref,
L: Deref + Clone,
@@ -17575,7 +17554,6 @@ impl<
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
SP::Target: SignerProvider,
- F::Target: FeeEstimator,
R::Target: Router,
MR::Target: MessageRouter,
L::Target: Logger,
diff --git a/lightning/src/ln/functional_test_utils.rs b/lightning/src/ln/functional_test_utils.rs
index e560e70..46af2b1 100644
--- a/lightning/src/ln/functional_test_utils.rs
+++ b/lightning/src/ln/functional_test_utils.rs
@@ -737,7 +737,7 @@ pub trait NodeHolder {
<Self::CM as AChannelManager>::EntropySource,
<Self::CM as AChannelManager>::NodeSigner,
<Self::CM as AChannelManager>::SP,
- <Self::CM as AChannelManager>::F,
+ <Self::CM as AChannelManager>::FeeEstimator,
<Self::CM as AChannelManager>::R,
<Self::CM as AChannelManager>::MR,
<Self::CM as AChannelManager>::L,
@@ -754,7 +754,7 @@ impl<H: NodeHolder> NodeHolder for &H {
<Self::CM as AChannelManager>::EntropySource,
<Self::CM as AChannelManager>::NodeSigner,
<Self::CM as AChannelManager>::SP,
- <Self::CM as AChannelManager>::F,
+ <Self::CM as AChannelManager>::FeeEstimator,
<Self::CM as AChannelManager>::R,
<Self::CM as AChannelManager>::MR,
<Self::CM as AChannelManager>::L,
diff --git a/lightning/src/util/anchor_channel_reserves.rs b/lightning/src/util/anchor_channel_reserves.rs
index 0e2f53a..92c5197 100644
--- a/lightning/src/util/anchor_channel_reserves.rs
+++ b/lightning/src/util/anchor_channel_reserves.rs
@@ -274,13 +274,11 @@ pub fn can_support_additional_anchor_channel<
ChannelSigner: EcdsaChannelSigner,
FilterRef: Deref,
B: BroadcasterInterface,
- EstimatorRef: Deref,
+ FE: FeeEstimator,
LoggerRef: Deref,
PersistRef: Deref,
ES: EntropySource,
- ChainMonitorRef: Deref<
- Target = ChainMonitor<ChannelSigner, FilterRef, B, EstimatorRef, LoggerRef, PersistRef, ES>,
- >,
+ ChainMonitorRef: Deref<Target = ChainMonitor<ChannelSigner, FilterRef, B, FE, LoggerRef, PersistRef, ES>>,
>(
context: &AnchorChannelReserveContext, utxos: &[Utxo], a_channel_manager: AChannelManagerRef,
chain_monitor: ChainMonitorRef,
@@ -288,7 +286,6 @@ pub fn can_support_additional_anchor_channel<
where
AChannelManagerRef::Target: AChannelManager,
FilterRef::Target: Filter,
- EstimatorRef::Target: FeeEstimator,
LoggerRef::Target: Logger,
PersistRef::Target: Persist<ChannelSigner>,
{
diff --git a/lightning/src/util/persist.rs b/lightning/src/util/persist.rs
index ecc2d94..3a94732 100644
--- a/lightning/src/util/persist.rs
+++ b/lightning/src/util/persist.rs
@@ -593,21 +593,25 @@ pub struct MonitorUpdatingPersister<
ES: EntropySource,
SP: Deref,
BI: BroadcasterInterface,
- FE: Deref,
+ FE: FeeEstimator,
>(MonitorUpdatingPersisterAsync<KVStoreSyncWrapper<K>, PanicingSpawner, L, ES, SP, BI, FE>)
where
K::Target: KVStoreSync,
L::Target: Logger,
- SP::Target: SignerProvider + Sized,
- FE::Target: FeeEstimator;
+ SP::Target: SignerProvider + Sized;
-impl<K: Deref, L: Deref, ES: EntropySource, SP: Deref, BI: BroadcasterInterface, FE: Deref>
- MonitorUpdatingPersister<K, L, ES, SP, BI, FE>
+impl<
+ K: Deref,
+ L: Deref,
+ ES: EntropySource,
+ SP: Deref,
+ BI: BroadcasterInterface,
+ FE: FeeEstimator,
+ > MonitorUpdatingPersister<K, L, ES, SP, BI, FE>
where
K::Target: KVStoreSync,
L::Target: Logger,
SP::Target: SignerProvider + Sized,
- FE::Target: FeeEstimator,
{
/// Constructs a new [`MonitorUpdatingPersister`].
///
@@ -698,13 +702,12 @@ impl<
ES: EntropySource,
SP: Deref,
BI: BroadcasterInterface,
- FE: Deref,
+ FE: FeeEstimator,
> Persist<ChannelSigner> for MonitorUpdatingPersister<K, L, ES, SP, BI, FE>
where
K::Target: KVStoreSync,
L::Target: Logger,
SP::Target: SignerProvider + Sized,
- FE::Target: FeeEstimator,
{
/// Persists a new channel. This means writing the entire monitor to the
/// parametrized [`KVStoreSync`].
@@ -782,13 +785,12 @@ pub struct MonitorUpdatingPersisterAsync<
ES: EntropySource,
SP: Deref,
BI: BroadcasterInterface,
- FE: Deref,
+ FE: FeeEstimator,
>(Arc<MonitorUpdatingPersisterAsyncInner<K, S, L, ES, SP, BI, FE>>)
where
K::Target: KVStore,
L::Target: Logger,
- SP::Target: SignerProvider + Sized,
- FE::Target: FeeEstimator;
+ SP::Target: SignerProvider + Sized;
struct MonitorUpdatingPersisterAsyncInner<
K: Deref,
@@ -797,12 +799,11 @@ struct MonitorUpdatingPersisterAsyncInner<
ES: EntropySource,
SP: Deref,
BI: BroadcasterInterface,
- FE: Deref,
+ FE: FeeEstimator,
> where
K::Target: KVStore,
L::Target: Logger,
SP::Target: SignerProvider + Sized,
- FE::Target: FeeEstimator,
{
kv_store: K,
async_completed_updates: Mutex<Vec<(ChannelId, u64)>>,
@@ -822,13 +823,12 @@ impl<
ES: EntropySource,
SP: Deref,
BI: BroadcasterInterface,
- FE: Deref,
+ FE: FeeEstimator,
> MonitorUpdatingPersisterAsync<K, S, L, ES, SP, BI, FE>
where
K::Target: KVStore,
L::Target: Logger,
SP::Target: SignerProvider + Sized,
- FE::Target: FeeEstimator,
{
/// Constructs a new [`MonitorUpdatingPersisterAsync`].
///
@@ -971,13 +971,12 @@ impl<
ES: EntropySource + MaybeSend + MaybeSync + 'static,
SP: Deref + MaybeSend + MaybeSync + 'static,
BI: BroadcasterInterface + MaybeSend + MaybeSync + 'static,
- FE: Deref + MaybeSend + MaybeSync + 'static,
+ FE: FeeEstimator + MaybeSend + MaybeSync + 'static,
> MonitorUpdatingPersisterAsync<K, S, L, ES, SP, BI, FE>
where
K::Target: KVStore + MaybeSync,
L::Target: Logger,
SP::Target: SignerProvider + Sized,
- FE::Target: FeeEstimator,
<SP::Target as SignerProvider>::EcdsaSigner: MaybeSend + 'static,
{
pub(crate) fn spawn_async_persist_new_channel(
@@ -1061,13 +1060,12 @@ impl<
ES: EntropySource,
SP: Deref,
BI: BroadcasterInterface,
- FE: Deref,
+ FE: FeeEstimator,
> MonitorUpdatingPersisterAsyncInner<K, S, L, ES, SP, BI, FE>
where
K::Target: KVStore,
L::Target: Logger,
SP::Target: SignerProvider + Sized,
- FE::Target: FeeEstimator,
{
pub async fn read_channel_monitor_with_updates(
&self, monitor_key: &str,
diff --git a/lightning/src/util/sweep.rs b/lightning/src/util/sweep.rs
index 6b3ce10..a408833 100644
--- a/lightning/src/util/sweep.rs
+++ b/lightning/src/util/sweep.rs
@@ -340,14 +340,13 @@ impl_writeable_tlv_based_enum!(OutputSpendStatus,
pub struct OutputSweeper<
B: BroadcasterInterface,
D: Deref,
- E: Deref,
+ E: FeeEstimator,
F: Deref,
K: Deref,
L: Deref,
O: Deref,
> where
D::Target: ChangeDestinationSource,
- E::Target: FeeEstimator,
F::Target: Filter,
K::Target: KVStore,
L::Target: Logger,
@@ -364,11 +363,17 @@ pub struct OutputSweeper<
logger: L,
}
-impl<B: BroadcasterInterface, D: Deref, E: Deref, F: Deref, K: Deref, L: Deref, O: Deref>
- OutputSweeper<B, D, E, F, K, L, O>
+impl<
+ B: BroadcasterInterface,
+ D: Deref,
+ E: FeeEstimator,
+ F: Deref,
+ K: Deref,
+ L: Deref,
+ O: Deref,
+ > OutputSweeper<B, D, E, F, K, L, O>
where
D::Target: ChangeDestinationSource,
- E::Target: FeeEstimator,
F::Target: Filter,
K::Target: KVStore,
L::Target: Logger,
@@ -715,11 +720,17 @@ where
}
}
-impl<B: BroadcasterInterface, D: Deref, E: Deref, F: Deref, K: Deref, L: Deref, O: Deref> Listen
- for OutputSweeper<B, D, E, F, K, L, O>
+impl<
+ B: BroadcasterInterface,
+ D: Deref,
+ E: FeeEstimator,
+ F: Deref,
+ K: Deref,
+ L: Deref,
+ O: Deref,
+ > Listen for OutputSweeper<B, D, E, F, K, L, O>
where
D::Target: ChangeDestinationSource,
- E::Target: FeeEstimator,
F::Target: Filter + Sync + Send,
K::Target: KVStore,
L::Target: Logger,
@@ -755,11 +766,17 @@ where
}
}
-impl<B: BroadcasterInterface, D: Deref, E: Deref, F: Deref, K: Deref, L: Deref, O: Deref> Confirm
- for OutputSweeper<B, D, E, F, K, L, O>
+impl<
+ B: BroadcasterInterface,
+ D: Deref,
+ E: FeeEstimator,
+ F: Deref,
+ K: Deref,
+ L: Deref,
+ O: Deref,
+ > Confirm for OutputSweeper<B, D, E, F, K, L, O>
where
D::Target: ChangeDestinationSource,
- E::Target: FeeEstimator,
F::Target: Filter + Sync + Send,
K::Target: KVStore,
L::Target: Logger,
@@ -851,11 +868,17 @@ pub enum SpendingDelay {
},
}
-impl<B: BroadcasterInterface, D: Deref, E: Deref, F: Deref, K: Deref, L: Deref, O: Deref>
- ReadableArgs<(B, E, Option<F>, O, D, K, L)> for (BestBlock, OutputSweeper<B, D, E, F, K, L, O>)
+impl<
+ B: BroadcasterInterface,
+ D: Deref,
+ E: FeeEstimator,
+ F: Deref,
+ K: Deref,
+ L: Deref,
+ O: Deref,
+ > ReadableArgs<(B, E, Option<F>, O, D, K, L)> for (BestBlock, OutputSweeper<B, D, E, F, K, L, O>)
where
D::Target: ChangeDestinationSource,
- E::Target: FeeEstimator,
F::Target: Filter + Sync + Send,
K::Target: KVStore,
L::Target: Logger,
@@ -923,14 +946,13 @@ where
pub struct OutputSweeperSync<
B: BroadcasterInterface,
D: Deref,
- E: Deref,
+ E: FeeEstimator,
F: Deref,
K: Deref,
L: Deref,
O: Deref,
> where
D::Target: ChangeDestinationSourceSync,
- E::Target: FeeEstimator,
F::Target: Filter,
K::Target: KVStoreSync,
L::Target: Logger,
@@ -940,11 +962,17 @@ pub struct OutputSweeperSync<
OutputSweeper<B, ChangeDestinationSourceSyncWrapper<D>, E, F, KVStoreSyncWrapper<K>, L, O>,
}
-impl<B: BroadcasterInterface, D: Deref, E: Deref, F: Deref, K: Deref, L: Deref, O: Deref>
- OutputSweeperSync<B, D, E, F, K, L, O>
+impl<
+ B: BroadcasterInterface,
+ D: Deref,
+ E: FeeEstimator,
+ F: Deref,
+ K: Deref,
+ L: Deref,
+ O: Deref,
+ > OutputSweeperSync<B, D, E, F, K, L, O>
where
D::Target: ChangeDestinationSourceSync,
- E::Target: FeeEstimator,
F::Target: Filter,
K::Target: KVStoreSync,
L::Target: Logger,
@@ -1059,11 +1087,17 @@ where
}
}
-impl<B: BroadcasterInterface, D: Deref, E: Deref, F: Deref, K: Deref, L: Deref, O: Deref> Listen
- for OutputSweeperSync<B, D, E, F, K, L, O>
+impl<
+ B: BroadcasterInterface,
+ D: Deref,
+ E: FeeEstimator,
+ F: Deref,
+ K: Deref,
+ L: Deref,
+ O: Deref,
+ > Listen for OutputSweeperSync<B, D, E, F, K, L, O>
where
D::Target: ChangeDestinationSourceSync,
- E::Target: FeeEstimator,
F::Target: Filter + Sync + Send,
K::Target: KVStoreSync,
L::Target: Logger,
@@ -1080,11 +1114,17 @@ where
}
}
-impl<B: BroadcasterInterface, D: Deref, E: Deref, F: Deref, K: Deref, L: Deref, O: Deref> Confirm
- for OutputSweeperSync<B, D, E, F, K, L, O>
+impl<
+ B: BroadcasterInterface,
+ D: Deref,
+ E: FeeEstimator,
+ F: Deref,
+ K: Deref,
+ L: Deref,
+ O: Deref,
+ > Confirm for OutputSweeperSync<B, D, E, F, K, L, O>
where
D::Target: ChangeDestinationSourceSync,
- E::Target: FeeEstimator,
F::Target: Filter + Sync + Send,
K::Target: KVStoreSync,
L::Target: Logger,
@@ -1109,11 +1149,18 @@ where
}
}
-impl<B: BroadcasterInterface, D: Deref, E: Deref, F: Deref, K: Deref, L: Deref, O: Deref>
- ReadableArgs<(B, E, Option<F>, O, D, K, L)> for (BestBlock, OutputSweeperSync<B, D, E, F, K, L, O>)
+impl<
+ B: BroadcasterInterface,
+ D: Deref,
+ E: FeeEstimator,
+ F: Deref,
+ K: Deref,
+ L: Deref,
+ O: Deref,
+ > ReadableArgs<(B, E, Option<F>, O, D, K, L)>
+ for (BestBlock, OutputSweeperSync<B, D, E, F, K, L, O>)
where
D::Target: ChangeDestinationSourceSync,
- E::Target: FeeEstimator,
F::Target: Filter + Sync + Send,
K::Target: KVStoreSync,
L::Target: Logger,
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.