Skip to content

Commit b9996d7

Browse files
committed
Most things in mod chain are now generic over segwit vs taproot
1 parent 615feef commit b9996d7

File tree

8 files changed

+77
-84
lines changed

8 files changed

+77
-84
lines changed

lightning/src/chain/chainmonitor.rs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use crate::chain::chaininterface::{BroadcasterInterface, FeeEstimator};
3232
use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, Balance, MonitorEvent, TransactionOutputs, WithChannelMonitor};
3333
use crate::chain::transaction::{OutPoint, TransactionData};
3434
use crate::ln::types::ChannelId;
35-
use crate::sign::ecdsa::EcdsaChannelSigner;
35+
use crate::sign::ChannelSigner;
3636
use crate::events::{self, Event, EventHandler, ReplayEvent};
3737
use crate::util::logger::{Logger, WithContext};
3838
use crate::util::errors::APIError;
@@ -101,7 +101,7 @@ use bitcoin::secp256k1::PublicKey;
101101
///
102102
/// [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
103103
/// [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
104-
pub trait Persist<ChannelSigner: EcdsaChannelSigner> {
104+
pub trait Persist<Signer: ChannelSigner> {
105105
/// Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
106106
/// called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
107107
///
@@ -118,7 +118,7 @@ pub trait Persist<ChannelSigner: EcdsaChannelSigner> {
118118
///
119119
/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
120120
/// [`Writeable::write`]: crate::util::ser::Writeable::write
121-
fn persist_new_channel(&self, channel_funding_outpoint: OutPoint, monitor: &ChannelMonitor<ChannelSigner>) -> ChannelMonitorUpdateStatus;
121+
fn persist_new_channel(&self, channel_funding_outpoint: OutPoint, monitor: &ChannelMonitor<Signer>) -> ChannelMonitorUpdateStatus;
122122

123123
/// Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
124124
/// update.
@@ -157,7 +157,7 @@ pub trait Persist<ChannelSigner: EcdsaChannelSigner> {
157157
/// [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
158158
///
159159
/// [`Writeable::write`]: crate::util::ser::Writeable::write
160-
fn update_persisted_channel(&self, channel_funding_outpoint: OutPoint, monitor_update: Option<&ChannelMonitorUpdate>, monitor: &ChannelMonitor<ChannelSigner>) -> ChannelMonitorUpdateStatus;
160+
fn update_persisted_channel(&self, channel_funding_outpoint: OutPoint, monitor_update: Option<&ChannelMonitorUpdate>, monitor: &ChannelMonitor<Signer>) -> ChannelMonitorUpdateStatus;
161161
/// Prevents the channel monitor from being loaded on startup.
162162
///
163163
/// Archiving the data in a backup location (rather than deleting it fully) is useful for
@@ -172,8 +172,8 @@ pub trait Persist<ChannelSigner: EcdsaChannelSigner> {
172172
fn archive_persisted_channel(&self, channel_funding_outpoint: OutPoint);
173173
}
174174

175-
struct MonitorHolder<ChannelSigner: EcdsaChannelSigner> {
176-
monitor: ChannelMonitor<ChannelSigner>,
175+
struct MonitorHolder<Signer: ChannelSigner> {
176+
monitor: ChannelMonitor<Signer>,
177177
/// The full set of pending monitor updates for this Channel.
178178
///
179179
/// Note that this lock must be held from [`ChannelMonitor::update_monitor`] through to
@@ -191,7 +191,7 @@ struct MonitorHolder<ChannelSigner: EcdsaChannelSigner> {
191191
pending_monitor_updates: Mutex<Vec<u64>>,
192192
}
193193

194-
impl<ChannelSigner: EcdsaChannelSigner> MonitorHolder<ChannelSigner> {
194+
impl<Signer: ChannelSigner> MonitorHolder<Signer> {
195195
fn has_pending_updates(&self, pending_monitor_updates_lock: &MutexGuard<Vec<u64>>) -> bool {
196196
!pending_monitor_updates_lock.is_empty()
197197
}
@@ -201,14 +201,14 @@ impl<ChannelSigner: EcdsaChannelSigner> MonitorHolder<ChannelSigner> {
201201
///
202202
/// Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
203203
/// released.
204-
pub struct LockedChannelMonitor<'a, ChannelSigner: EcdsaChannelSigner> {
205-
lock: RwLockReadGuard<'a, HashMap<OutPoint, MonitorHolder<ChannelSigner>>>,
204+
pub struct LockedChannelMonitor<'a, Signer: ChannelSigner> {
205+
lock: RwLockReadGuard<'a, HashMap<OutPoint, MonitorHolder<Signer>>>,
206206
funding_txo: OutPoint,
207207
}
208208

209-
impl<ChannelSigner: EcdsaChannelSigner> Deref for LockedChannelMonitor<'_, ChannelSigner> {
210-
type Target = ChannelMonitor<ChannelSigner>;
211-
fn deref(&self) -> &ChannelMonitor<ChannelSigner> {
209+
impl<Signer: ChannelSigner> Deref for LockedChannelMonitor<'_, Signer> {
210+
type Target = ChannelMonitor<Signer>;
211+
fn deref(&self) -> &ChannelMonitor<Signer> {
212212
&self.lock.get(&self.funding_txo).expect("Checked at construction").monitor
213213
}
214214
}
@@ -229,14 +229,14 @@ impl<ChannelSigner: EcdsaChannelSigner> Deref for LockedChannelMonitor<'_, Chann
229229
/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
230230
/// [module-level documentation]: crate::chain::chainmonitor
231231
/// [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
232-
pub struct ChainMonitor<ChannelSigner: EcdsaChannelSigner, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref>
232+
pub struct ChainMonitor<Signer: ChannelSigner, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref>
233233
where C::Target: chain::Filter,
234234
T::Target: BroadcasterInterface,
235235
F::Target: FeeEstimator,
236236
L::Target: Logger,
237-
P::Target: Persist<ChannelSigner>,
237+
P::Target: Persist<Signer>,
238238
{
239-
monitors: RwLock<HashMap<OutPoint, MonitorHolder<ChannelSigner>>>,
239+
monitors: RwLock<HashMap<OutPoint, MonitorHolder<Signer>>>,
240240
chain_source: Option<C>,
241241
broadcaster: T,
242242
logger: L,
@@ -253,12 +253,12 @@ pub struct ChainMonitor<ChannelSigner: EcdsaChannelSigner, C: Deref, T: Deref, F
253253
event_notifier: Notifier,
254254
}
255255

256-
impl<ChannelSigner: EcdsaChannelSigner, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref> ChainMonitor<ChannelSigner, C, T, F, L, P>
256+
impl<Signer: ChannelSigner, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref> ChainMonitor<Signer, C, T, F, L, P>
257257
where C::Target: chain::Filter,
258258
T::Target: BroadcasterInterface,
259259
F::Target: FeeEstimator,
260260
L::Target: Logger,
261-
P::Target: Persist<ChannelSigner>,
261+
P::Target: Persist<Signer>,
262262
{
263263
/// Dispatches to per-channel monitors, which are responsible for updating their on-chain view
264264
/// of a channel and reacting accordingly based on transactions in the given chain data. See
@@ -273,7 +273,7 @@ where C::Target: chain::Filter,
273273
/// Calls which represent a new blockchain tip height should set `best_height`.
274274
fn process_chain_data<FN>(&self, header: &Header, best_height: Option<u32>, txdata: &TransactionData, process: FN)
275275
where
276-
FN: Fn(&ChannelMonitor<ChannelSigner>, &TransactionData) -> Vec<TransactionOutputs>
276+
FN: Fn(&ChannelMonitor<Signer>, &TransactionData) -> Vec<TransactionOutputs>
277277
{
278278
let err_str = "ChannelMonitor[Update] persistence failed unrecoverably. This indicates we cannot continue normal operation and must shut down.";
279279
let funding_outpoints = hash_set_from_iter(self.monitors.read().unwrap().keys().cloned());
@@ -316,8 +316,8 @@ where C::Target: chain::Filter,
316316

317317
fn update_monitor_with_chain_data<FN>(
318318
&self, header: &Header, best_height: Option<u32>, txdata: &TransactionData, process: FN, funding_outpoint: &OutPoint,
319-
monitor_state: &MonitorHolder<ChannelSigner>, channel_count: usize,
320-
) -> Result<(), ()> where FN: Fn(&ChannelMonitor<ChannelSigner>, &TransactionData) -> Vec<TransactionOutputs> {
319+
monitor_state: &MonitorHolder<Signer>, channel_count: usize,
320+
) -> Result<(), ()> where FN: Fn(&ChannelMonitor<Signer>, &TransactionData) -> Vec<TransactionOutputs> {
321321
let monitor = &monitor_state.monitor;
322322
let logger = WithChannelMonitor::from(&self.logger, &monitor, None);
323323

@@ -428,7 +428,7 @@ where C::Target: chain::Filter,
428428
///
429429
/// Note that the result holds a mutex over our monitor set, and should not be held
430430
/// indefinitely.
431-
pub fn get_monitor(&self, funding_txo: OutPoint) -> Result<LockedChannelMonitor<'_, ChannelSigner>, ()> {
431+
pub fn get_monitor(&self, funding_txo: OutPoint) -> Result<LockedChannelMonitor<'_, Signer>, ()> {
432432
let lock = self.monitors.read().unwrap();
433433
if lock.get(&funding_txo).is_some() {
434434
Ok(LockedChannelMonitor { lock, funding_txo })
@@ -472,7 +472,7 @@ where C::Target: chain::Filter,
472472

473473

474474
#[cfg(test)]
475-
pub fn remove_monitor(&self, funding_txo: &OutPoint) -> ChannelMonitor<ChannelSigner> {
475+
pub fn remove_monitor(&self, funding_txo: &OutPoint) -> ChannelMonitor<Signer> {
476476
self.monitors.write().unwrap().remove(funding_txo).unwrap().monitor
477477
}
478478

@@ -670,14 +670,14 @@ where C::Target: chain::Filter,
670670
}
671671
}
672672

673-
impl<ChannelSigner: EcdsaChannelSigner, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref>
674-
chain::Listen for ChainMonitor<ChannelSigner, C, T, F, L, P>
673+
impl<Signer: ChannelSigner, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref>
674+
chain::Listen for ChainMonitor<Signer, C, T, F, L, P>
675675
where
676676
C::Target: chain::Filter,
677677
T::Target: BroadcasterInterface,
678678
F::Target: FeeEstimator,
679679
L::Target: Logger,
680-
P::Target: Persist<ChannelSigner>,
680+
P::Target: Persist<Signer>,
681681
{
682682
fn filtered_block_connected(&self, header: &Header, txdata: &TransactionData, height: u32) {
683683
log_debug!(self.logger, "New best block {} at height {} provided via block_connected", header.block_hash(), height);
@@ -699,14 +699,14 @@ where
699699
}
700700
}
701701

702-
impl<ChannelSigner: EcdsaChannelSigner, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref>
703-
chain::Confirm for ChainMonitor<ChannelSigner, C, T, F, L, P>
702+
impl<Signer: ChannelSigner, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref>
703+
chain::Confirm for ChainMonitor<Signer, C, T, F, L, P>
704704
where
705705
C::Target: chain::Filter,
706706
T::Target: BroadcasterInterface,
707707
F::Target: FeeEstimator,
708708
L::Target: Logger,
709-
P::Target: Persist<ChannelSigner>,
709+
P::Target: Persist<Signer>,
710710
{
711711
fn transactions_confirmed(&self, header: &Header, txdata: &TransactionData, height: u32) {
712712
log_debug!(self.logger, "{} provided transactions confirmed at height {} in block {}", txdata.len(), height, header.block_hash());
@@ -753,15 +753,15 @@ where
753753
}
754754
}
755755

756-
impl<ChannelSigner: EcdsaChannelSigner, C: Deref , T: Deref , F: Deref , L: Deref , P: Deref >
757-
chain::Watch<ChannelSigner> for ChainMonitor<ChannelSigner, C, T, F, L, P>
756+
impl<Signer: ChannelSigner, C: Deref , T: Deref , F: Deref , L: Deref , P: Deref >
757+
chain::Watch<Signer> for ChainMonitor<Signer, C, T, F, L, P>
758758
where C::Target: chain::Filter,
759759
T::Target: BroadcasterInterface,
760760
F::Target: FeeEstimator,
761761
L::Target: Logger,
762-
P::Target: Persist<ChannelSigner>,
762+
P::Target: Persist<Signer>,
763763
{
764-
fn watch_channel(&self, funding_outpoint: OutPoint, monitor: ChannelMonitor<ChannelSigner>) -> Result<ChannelMonitorUpdateStatus, ()> {
764+
fn watch_channel(&self, funding_outpoint: OutPoint, monitor: ChannelMonitor<Signer>) -> Result<ChannelMonitorUpdateStatus, ()> {
765765
let logger = WithChannelMonitor::from(&self.logger, &monitor, None);
766766
let mut monitors = self.monitors.write().unwrap();
767767
let entry = match monitors.entry(funding_outpoint) {
@@ -892,12 +892,12 @@ where C::Target: chain::Filter,
892892
}
893893
}
894894

895-
impl<ChannelSigner: EcdsaChannelSigner, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref> events::EventsProvider for ChainMonitor<ChannelSigner, C, T, F, L, P>
895+
impl<Signer: ChannelSigner, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref> events::EventsProvider for ChainMonitor<Signer, C, T, F, L, P>
896896
where C::Target: chain::Filter,
897897
T::Target: BroadcasterInterface,
898898
F::Target: FeeEstimator,
899899
L::Target: Logger,
900-
P::Target: Persist<ChannelSigner>,
900+
P::Target: Persist<Signer>,
901901
{
902902
/// Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
903903
///

lightning/src/chain/channelmonitor.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use crate::chain;
4242
use crate::chain::{BestBlock, WatchedOutput};
4343
use crate::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator, LowerBoundedFeeEstimator};
4444
use crate::chain::transaction::{OutPoint, TransactionData};
45-
use crate::sign::{ChannelDerivationParameters, HTLCDescriptor, SpendableOutputDescriptor, StaticPaymentOutputDescriptor, DelayedPaymentOutputDescriptor, ecdsa::EcdsaChannelSigner, SignerProvider, EntropySource};
45+
use crate::sign::{ChannelDerivationParameters, HTLCDescriptor, SpendableOutputDescriptor, StaticPaymentOutputDescriptor, DelayedPaymentOutputDescriptor, ChannelSigner, SignerProvider, EntropySource};
4646
use crate::chain::onchaintx::{ClaimEvent, FeerateStrategy, OnchainTxHandler};
4747
use crate::chain::package::{CounterpartyOfferedHTLCOutput, CounterpartyReceivedHTLCOutput, HolderFundingOutput, HolderHTLCOutput, PackageSolvingData, PackageTemplate, RevokedOutput, RevokedHTLCOutput};
4848
use crate::chain::Filter;
@@ -846,22 +846,22 @@ impl Readable for IrrevocablyResolvedHTLC {
846846
/// the "reorg path" (ie disconnecting blocks until you find a common ancestor from both the
847847
/// returned block hash and the the current chain and then reconnecting blocks to get to the
848848
/// best chain) upon deserializing the object!
849-
pub struct ChannelMonitor<Signer: EcdsaChannelSigner> {
849+
pub struct ChannelMonitor<Signer: ChannelSigner> {
850850
#[cfg(test)]
851851
pub(crate) inner: Mutex<ChannelMonitorImpl<Signer>>,
852852
#[cfg(not(test))]
853853
pub(super) inner: Mutex<ChannelMonitorImpl<Signer>>,
854854
}
855855

856-
impl<Signer: EcdsaChannelSigner> Clone for ChannelMonitor<Signer> where Signer: Clone {
856+
impl<Signer: ChannelSigner> Clone for ChannelMonitor<Signer> where Signer: Clone {
857857
fn clone(&self) -> Self {
858858
let inner = self.inner.lock().unwrap().clone();
859859
ChannelMonitor::from_impl(inner)
860860
}
861861
}
862862

863863
#[derive(Clone, PartialEq)]
864-
pub(crate) struct ChannelMonitorImpl<Signer: EcdsaChannelSigner> {
864+
pub(crate) struct ChannelMonitorImpl<Signer: ChannelSigner> {
865865
latest_update_id: u64,
866866
commitment_transaction_number_obscure_factor: u64,
867867

@@ -1027,7 +1027,7 @@ pub(crate) struct ChannelMonitorImpl<Signer: EcdsaChannelSigner> {
10271027
/// Transaction outputs to watch for on-chain spends.
10281028
pub type TransactionOutputs = (Txid, Vec<(u32, TxOut)>);
10291029

1030-
impl<Signer: EcdsaChannelSigner> PartialEq for ChannelMonitor<Signer> where Signer: PartialEq {
1030+
impl<Signer: ChannelSigner> PartialEq for ChannelMonitor<Signer> where Signer: PartialEq {
10311031
fn eq(&self, other: &Self) -> bool {
10321032
// We need some kind of total lockorder. Absent a better idea, we sort by position in
10331033
// memory and take locks in that order (assuming that we can't move within memory while a
@@ -1039,7 +1039,7 @@ impl<Signer: EcdsaChannelSigner> PartialEq for ChannelMonitor<Signer> where Sign
10391039
}
10401040
}
10411041

1042-
impl<Signer: EcdsaChannelSigner> Writeable for ChannelMonitor<Signer> {
1042+
impl<Signer: ChannelSigner> Writeable for ChannelMonitor<Signer> {
10431043
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error> {
10441044
self.inner.lock().unwrap().write(writer)
10451045
}
@@ -1049,7 +1049,7 @@ impl<Signer: EcdsaChannelSigner> Writeable for ChannelMonitor<Signer> {
10491049
const SERIALIZATION_VERSION: u8 = 1;
10501050
const MIN_SERIALIZATION_VERSION: u8 = 1;
10511051

1052-
impl<Signer: EcdsaChannelSigner> Writeable for ChannelMonitorImpl<Signer> {
1052+
impl<Signer: ChannelSigner> Writeable for ChannelMonitorImpl<Signer> {
10531053
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error> {
10541054
write_ver_prefix!(writer, SERIALIZATION_VERSION, MIN_SERIALIZATION_VERSION);
10551055

@@ -1316,11 +1316,11 @@ impl<'a, L: Deref> Logger for WithChannelMonitor<'a, L> where L::Target: Logger
13161316
}
13171317

13181318
impl<'a, L: Deref> WithChannelMonitor<'a, L> where L::Target: Logger {
1319-
pub(crate) fn from<S: EcdsaChannelSigner>(logger: &'a L, monitor: &ChannelMonitor<S>, payment_hash: Option<PaymentHash>) -> Self {
1319+
pub(crate) fn from<S: ChannelSigner>(logger: &'a L, monitor: &ChannelMonitor<S>, payment_hash: Option<PaymentHash>) -> Self {
13201320
Self::from_impl(logger, &*monitor.inner.lock().unwrap(), payment_hash)
13211321
}
13221322

1323-
pub(crate) fn from_impl<S: EcdsaChannelSigner>(logger: &'a L, monitor_impl: &ChannelMonitorImpl<S>, payment_hash: Option<PaymentHash>) -> Self {
1323+
pub(crate) fn from_impl<S: ChannelSigner>(logger: &'a L, monitor_impl: &ChannelMonitorImpl<S>, payment_hash: Option<PaymentHash>) -> Self {
13241324
let peer_id = monitor_impl.counterparty_node_id;
13251325
let channel_id = Some(monitor_impl.channel_id());
13261326
WithChannelMonitor {
@@ -1329,7 +1329,7 @@ impl<'a, L: Deref> WithChannelMonitor<'a, L> where L::Target: Logger {
13291329
}
13301330
}
13311331

1332-
impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
1332+
impl<Signer: ChannelSigner> ChannelMonitor<Signer> {
13331333
/// For lockorder enforcement purposes, we need to have a single site which constructs the
13341334
/// `inner` mutex, otherwise cases where we lock two monitors at the same time (eg in our
13351335
/// PartialEq implementation) we may decide a lockorder violation has occurred.
@@ -2085,7 +2085,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
20852085
}
20862086
}
20872087

2088-
impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
2088+
impl<Signer: ChannelSigner> ChannelMonitorImpl<Signer> {
20892089
/// Helper for get_claimable_balances which does the work for an individual HTLC, generating up
20902090
/// to one `Balance` for the HTLC.
20912091
fn get_htlc_balance(&self, htlc: &HTLCOutputInCommitment, source: Option<&HTLCSource>,
@@ -2276,7 +2276,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
22762276
}
22772277
}
22782278

2279-
impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
2279+
impl<Signer: ChannelSigner> ChannelMonitor<Signer> {
22802280
/// Gets the balances in this channel which are either claimable by us if we were to
22812281
/// force-close the channel now or which are claimable on-chain (possibly awaiting
22822282
/// confirmation).
@@ -2736,7 +2736,7 @@ pub fn deliberately_bogus_accepted_htlc_witness() -> Vec<Vec<u8>> {
27362736
vec![Vec::new(), Vec::new(), Vec::new(), Vec::new(), deliberately_bogus_accepted_htlc_witness_program().into()].into()
27372737
}
27382738

2739-
impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
2739+
impl<Signer: ChannelSigner> ChannelMonitorImpl<Signer> {
27402740
/// Gets the [`ConfirmationTarget`] we should use when selecting feerates for channel closure
27412741
/// transactions for this channel right now.
27422742
fn closure_conf_target(&self) -> ConfirmationTarget {
@@ -4673,7 +4673,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
46734673
}
46744674
}
46754675

4676-
impl<Signer: EcdsaChannelSigner, T: Deref, F: Deref, L: Deref> chain::Listen for (ChannelMonitor<Signer>, T, F, L)
4676+
impl<Signer: ChannelSigner, T: Deref, F: Deref, L: Deref> chain::Listen for (ChannelMonitor<Signer>, T, F, L)
46774677
where
46784678
T::Target: BroadcasterInterface,
46794679
F::Target: FeeEstimator,
@@ -4688,7 +4688,7 @@ where
46884688
}
46894689
}
46904690

4691-
impl<Signer: EcdsaChannelSigner, M, T: Deref, F: Deref, L: Deref> chain::Confirm for (M, T, F, L)
4691+
impl<Signer: ChannelSigner, M, T: Deref, F: Deref, L: Deref> chain::Confirm for (M, T, F, L)
46924692
where
46934693
M: Deref<Target = ChannelMonitor<Signer>>,
46944694
T::Target: BroadcasterInterface,

lightning/src/chain/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use bitcoin::secp256k1::PublicKey;
1818

1919
use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, MonitorEvent};
2020
use crate::ln::types::ChannelId;
21-
use crate::sign::ecdsa::EcdsaChannelSigner;
21+
use crate::sign::ChannelSigner;
2222
use crate::chain::transaction::{OutPoint, TransactionData};
2323
use crate::impl_writeable_tlv_based;
2424

@@ -260,7 +260,7 @@ pub enum ChannelMonitorUpdateStatus {
260260
/// application crashes.
261261
///
262262
/// See method documentation and [`ChannelMonitorUpdateStatus`] for specific requirements.
263-
pub trait Watch<ChannelSigner: EcdsaChannelSigner> {
263+
pub trait Watch<Signer: ChannelSigner> {
264264
/// Watches a channel identified by `funding_txo` using `monitor`.
265265
///
266266
/// Implementations are responsible for watching the chain for the funding transaction along
@@ -276,7 +276,7 @@ pub trait Watch<ChannelSigner: EcdsaChannelSigner> {
276276
/// [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
277277
/// [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
278278
/// [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
279-
fn watch_channel(&self, funding_txo: OutPoint, monitor: ChannelMonitor<ChannelSigner>) -> Result<ChannelMonitorUpdateStatus, ()>;
279+
fn watch_channel(&self, funding_txo: OutPoint, monitor: ChannelMonitor<Signer>) -> Result<ChannelMonitorUpdateStatus, ()>;
280280

281281
/// Updates a channel identified by `funding_txo` by applying `update` to its monitor.
282282
///

0 commit comments

Comments
 (0)