Skip to content

Commit 2d4d20e

Browse files
committed
Rename ChannelKeys -> Sign and generic it consistently
The `ChannelKeys` object really isn't about keys at all anymore, its all about signing. At the same time, we rename the type aliases used in traits from both `ChanKeySigner` and `Keys` to just `Signer` (or, in contexts where Channel isnt clear, `ChanSigner`).
1 parent 414e622 commit 2d4d20e

19 files changed

+291
-291
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ use lightning::chain::channelmonitor;
3434
use lightning::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdateErr, MonitorEvent};
3535
use lightning::chain::transaction::OutPoint;
3636
use lightning::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator};
37-
use lightning::chain::keysinterface::{KeysInterface, InMemoryChannelKeys};
37+
use lightning::chain::keysinterface::{KeysInterface, InMemorySigner};
3838
use lightning::ln::channelmanager::{ChannelManager, PaymentHash, PaymentPreimage, PaymentSecret, PaymentSendFailure, ChannelManagerReadArgs};
3939
use lightning::ln::features::{ChannelFeatures, InitFeatures, NodeFeatures};
4040
use lightning::ln::msgs::{CommitmentUpdate, ChannelMessageHandler, DecodeError, ErrorAction, UpdateAddHTLC, Init};
41-
use lightning::util::enforcing_trait_impls::{EnforcingChannelKeys, INITIAL_REVOKED_COMMITMENT_NUMBER};
41+
use lightning::util::enforcing_trait_impls::{EnforcingSigner, INITIAL_REVOKED_COMMITMENT_NUMBER};
4242
use lightning::util::errors::APIError;
4343
use lightning::util::events;
4444
use lightning::util::logger::Logger;
@@ -87,7 +87,7 @@ impl Writer for VecWriter {
8787

8888
struct TestChainMonitor {
8989
pub logger: Arc<dyn Logger>,
90-
pub chain_monitor: Arc<chainmonitor::ChainMonitor<EnforcingChannelKeys, Arc<dyn chain::Filter>, Arc<TestBroadcaster>, Arc<FuzzEstimator>, Arc<dyn Logger>, Arc<TestPersister>>>,
90+
pub chain_monitor: Arc<chainmonitor::ChainMonitor<EnforcingSigner, Arc<dyn chain::Filter>, Arc<TestBroadcaster>, Arc<FuzzEstimator>, Arc<dyn Logger>, Arc<TestPersister>>>,
9191
pub update_ret: Mutex<Result<(), channelmonitor::ChannelMonitorUpdateErr>>,
9292
// If we reload a node with an old copy of ChannelMonitors, the ChannelManager deserialization
9393
// logic will automatically force-close our channels for us (as we don't have an up-to-date
@@ -109,9 +109,9 @@ impl TestChainMonitor {
109109
}
110110
}
111111
impl chain::Watch for TestChainMonitor {
112-
type Keys = EnforcingChannelKeys;
112+
type ChanSigner = EnforcingSigner;
113113

114-
fn watch_channel(&self, funding_txo: OutPoint, monitor: channelmonitor::ChannelMonitor<EnforcingChannelKeys>) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
114+
fn watch_channel(&self, funding_txo: OutPoint, monitor: channelmonitor::ChannelMonitor<EnforcingSigner>) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
115115
let mut ser = VecWriter(Vec::new());
116116
monitor.write(&mut ser).unwrap();
117117
if let Some(_) = self.latest_monitors.lock().unwrap().insert(funding_txo, (monitor.get_latest_update_id(), ser.0)) {
@@ -128,7 +128,7 @@ impl chain::Watch for TestChainMonitor {
128128
hash_map::Entry::Occupied(entry) => entry,
129129
hash_map::Entry::Vacant(_) => panic!("Didn't have monitor on update call"),
130130
};
131-
let mut deserialized_monitor = <(BlockHash, channelmonitor::ChannelMonitor<EnforcingChannelKeys>)>::
131+
let mut deserialized_monitor = <(BlockHash, channelmonitor::ChannelMonitor<EnforcingSigner>)>::
132132
read(&mut Cursor::new(&map_entry.get().1), &OnlyReadsKeysInterface {}).unwrap().1;
133133
deserialized_monitor.update_monitor(&update, &&TestBroadcaster{}, &&FuzzEstimator{}, &self.logger).unwrap();
134134
let mut ser = VecWriter(Vec::new());
@@ -149,7 +149,7 @@ struct KeyProvider {
149149
revoked_commitments: Mutex<HashMap<[u8;32], Arc<Mutex<u64>>>>,
150150
}
151151
impl KeysInterface for KeyProvider {
152-
type ChanKeySigner = EnforcingChannelKeys;
152+
type Signer = EnforcingSigner;
153153

154154
fn get_node_secret(&self) -> SecretKey {
155155
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, self.node_id]).unwrap()
@@ -167,10 +167,10 @@ impl KeysInterface for KeyProvider {
167167
PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, self.node_id]).unwrap())
168168
}
169169

170-
fn get_channel_keys(&self, _inbound: bool, channel_value_satoshis: u64) -> EnforcingChannelKeys {
170+
fn get_channel_signer(&self, _inbound: bool, channel_value_satoshis: u64) -> EnforcingSigner {
171171
let secp_ctx = Secp256k1::signing_only();
172172
let id = self.rand_bytes_id.fetch_add(1, atomic::Ordering::Relaxed);
173-
let keys = InMemoryChannelKeys::new(
173+
let keys = InMemorySigner::new(
174174
&secp_ctx,
175175
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, self.node_id]).unwrap(),
176176
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, self.node_id]).unwrap(),
@@ -182,23 +182,23 @@ impl KeysInterface for KeyProvider {
182182
[0; 32],
183183
);
184184
let revoked_commitment = self.make_revoked_commitment_cell(keys.commitment_seed);
185-
EnforcingChannelKeys::new_with_revoked(keys, revoked_commitment, false)
185+
EnforcingSigner::new_with_revoked(keys, revoked_commitment, false)
186186
}
187187

188188
fn get_secure_random_bytes(&self) -> [u8; 32] {
189189
let id = self.rand_bytes_id.fetch_add(1, atomic::Ordering::Relaxed);
190190
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, id, 11, self.node_id]
191191
}
192192

193-
fn read_chan_signer(&self, buffer: &[u8]) -> Result<Self::ChanKeySigner, DecodeError> {
193+
fn read_chan_signer(&self, buffer: &[u8]) -> Result<Self::Signer, DecodeError> {
194194
let mut reader = std::io::Cursor::new(buffer);
195195

196-
let inner: InMemoryChannelKeys = Readable::read(&mut reader)?;
196+
let inner: InMemorySigner = Readable::read(&mut reader)?;
197197
let revoked_commitment = self.make_revoked_commitment_cell(inner.commitment_seed);
198198

199199
let last_commitment_number = Readable::read(&mut reader)?;
200200

201-
Ok(EnforcingChannelKeys {
201+
Ok(EnforcingSigner {
202202
inner,
203203
last_commitment_number: Arc::new(Mutex::new(last_commitment_number)),
204204
revoked_commitment,
@@ -259,7 +259,7 @@ fn check_payment_err(send_err: PaymentSendFailure) {
259259
}
260260
}
261261

262-
type ChanMan = ChannelManager<EnforcingChannelKeys, Arc<TestChainMonitor>, Arc<TestBroadcaster>, Arc<KeyProvider>, Arc<FuzzEstimator>, Arc<dyn Logger>>;
262+
type ChanMan = ChannelManager<EnforcingSigner, Arc<TestChainMonitor>, Arc<TestBroadcaster>, Arc<KeyProvider>, Arc<FuzzEstimator>, Arc<dyn Logger>>;
263263

264264
#[inline]
265265
fn send_payment(source: &ChanMan, dest: &ChanMan, dest_chan_id: u64, amt: u64, payment_id: &mut u8) -> bool {
@@ -339,7 +339,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
339339
let mut monitors = HashMap::new();
340340
let mut old_monitors = $old_monitors.latest_monitors.lock().unwrap();
341341
for (outpoint, (update_id, monitor_ser)) in old_monitors.drain() {
342-
monitors.insert(outpoint, <(BlockHash, ChannelMonitor<EnforcingChannelKeys>)>::read(&mut Cursor::new(&monitor_ser), &OnlyReadsKeysInterface {}).expect("Failed to read monitor").1);
342+
monitors.insert(outpoint, <(BlockHash, ChannelMonitor<EnforcingSigner>)>::read(&mut Cursor::new(&monitor_ser), &OnlyReadsKeysInterface {}).expect("Failed to read monitor").1);
343343
chain_monitor.latest_monitors.lock().unwrap().insert(outpoint, (update_id, monitor_ser));
344344
}
345345
let mut monitor_refs = HashMap::new();

fuzz/src/chanmon_deser.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use bitcoin::hash_types::BlockHash;
55

66
use lightning::chain::channelmonitor;
7-
use lightning::util::enforcing_trait_impls::EnforcingChannelKeys;
7+
use lightning::util::enforcing_trait_impls::EnforcingSigner;
88
use lightning::util::ser::{ReadableArgs, Writer, Writeable};
99
use lightning::util::test_utils::OnlyReadsKeysInterface;
1010

@@ -25,10 +25,10 @@ impl Writer for VecWriter {
2525

2626
#[inline]
2727
pub fn do_test<Out: test_logger::Output>(data: &[u8], _out: Out) {
28-
if let Ok((latest_block_hash, monitor)) = <(BlockHash, channelmonitor::ChannelMonitor<EnforcingChannelKeys>)>::read(&mut Cursor::new(data), &OnlyReadsKeysInterface {}) {
28+
if let Ok((latest_block_hash, monitor)) = <(BlockHash, channelmonitor::ChannelMonitor<EnforcingSigner>)>::read(&mut Cursor::new(data), &OnlyReadsKeysInterface {}) {
2929
let mut w = VecWriter(Vec::new());
3030
monitor.write(&mut w).unwrap();
31-
let deserialized_copy = <(BlockHash, channelmonitor::ChannelMonitor<EnforcingChannelKeys>)>::read(&mut Cursor::new(&w.0), &OnlyReadsKeysInterface {}).unwrap();
31+
let deserialized_copy = <(BlockHash, channelmonitor::ChannelMonitor<EnforcingSigner>)>::read(&mut Cursor::new(&w.0), &OnlyReadsKeysInterface {}).unwrap();
3232
assert!(latest_block_hash == deserialized_copy.0);
3333
assert!(monitor == deserialized_copy.1);
3434
}

fuzz/src/full_stack.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ use lightning::chain;
3030
use lightning::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator};
3131
use lightning::chain::chainmonitor;
3232
use lightning::chain::transaction::OutPoint;
33-
use lightning::chain::keysinterface::{InMemoryChannelKeys, KeysInterface};
33+
use lightning::chain::keysinterface::{InMemorySigner, KeysInterface};
3434
use lightning::ln::channelmanager::{ChannelManager, PaymentHash, PaymentPreimage, PaymentSecret};
3535
use lightning::ln::peer_handler::{MessageHandler,PeerManager,SocketDescriptor};
3636
use lightning::ln::msgs::DecodeError;
3737
use lightning::routing::router::get_route;
3838
use lightning::routing::network_graph::NetGraphMsgHandler;
3939
use lightning::util::config::UserConfig;
4040
use lightning::util::events::{EventsProvider,Event};
41-
use lightning::util::enforcing_trait_impls::EnforcingChannelKeys;
41+
use lightning::util::enforcing_trait_impls::EnforcingSigner;
4242
use lightning::util::logger::Logger;
4343
use lightning::util::ser::Readable;
4444

@@ -148,14 +148,14 @@ impl<'a> std::hash::Hash for Peer<'a> {
148148
}
149149

150150
type ChannelMan = ChannelManager<
151-
EnforcingChannelKeys,
152-
Arc<chainmonitor::ChainMonitor<EnforcingChannelKeys, Arc<dyn chain::Filter>, Arc<TestBroadcaster>, Arc<FuzzEstimator>, Arc<dyn Logger>, Arc<TestPersister>>>,
151+
EnforcingSigner,
152+
Arc<chainmonitor::ChainMonitor<EnforcingSigner, Arc<dyn chain::Filter>, Arc<TestBroadcaster>, Arc<FuzzEstimator>, Arc<dyn Logger>, Arc<TestPersister>>>,
153153
Arc<TestBroadcaster>, Arc<KeyProvider>, Arc<FuzzEstimator>, Arc<dyn Logger>>;
154154
type PeerMan<'a> = PeerManager<Peer<'a>, Arc<ChannelMan>, Arc<NetGraphMsgHandler<Arc<dyn chain::Access>, Arc<dyn Logger>>>, Arc<dyn Logger>>;
155155

156156
struct MoneyLossDetector<'a> {
157157
manager: Arc<ChannelMan>,
158-
monitor: Arc<chainmonitor::ChainMonitor<EnforcingChannelKeys, Arc<dyn chain::Filter>, Arc<TestBroadcaster>, Arc<FuzzEstimator>, Arc<dyn Logger>, Arc<TestPersister>>>,
158+
monitor: Arc<chainmonitor::ChainMonitor<EnforcingSigner, Arc<dyn chain::Filter>, Arc<TestBroadcaster>, Arc<FuzzEstimator>, Arc<dyn Logger>, Arc<TestPersister>>>,
159159
handler: PeerMan<'a>,
160160

161161
peers: &'a RefCell<[bool; 256]>,
@@ -169,7 +169,7 @@ struct MoneyLossDetector<'a> {
169169
impl<'a> MoneyLossDetector<'a> {
170170
pub fn new(peers: &'a RefCell<[bool; 256]>,
171171
manager: Arc<ChannelMan>,
172-
monitor: Arc<chainmonitor::ChainMonitor<EnforcingChannelKeys, Arc<dyn chain::Filter>, Arc<TestBroadcaster>, Arc<FuzzEstimator>, Arc<dyn Logger>, Arc<TestPersister>>>,
172+
monitor: Arc<chainmonitor::ChainMonitor<EnforcingSigner, Arc<dyn chain::Filter>, Arc<TestBroadcaster>, Arc<FuzzEstimator>, Arc<dyn Logger>, Arc<TestPersister>>>,
173173
handler: PeerMan<'a>) -> Self {
174174
MoneyLossDetector {
175175
manager,
@@ -248,7 +248,7 @@ struct KeyProvider {
248248
counter: AtomicU64,
249249
}
250250
impl KeysInterface for KeyProvider {
251-
type ChanKeySigner = EnforcingChannelKeys;
251+
type Signer = EnforcingSigner;
252252

253253
fn get_node_secret(&self) -> SecretKey {
254254
self.node_secret.clone()
@@ -266,11 +266,11 @@ impl KeysInterface for KeyProvider {
266266
PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]).unwrap())
267267
}
268268

269-
fn get_channel_keys(&self, inbound: bool, channel_value_satoshis: u64) -> EnforcingChannelKeys {
269+
fn get_channel_signer(&self, inbound: bool, channel_value_satoshis: u64) -> EnforcingSigner {
270270
let ctr = self.counter.fetch_add(1, Ordering::Relaxed) as u8;
271271
let secp_ctx = Secp256k1::signing_only();
272-
EnforcingChannelKeys::new(if inbound {
273-
InMemoryChannelKeys::new(
272+
EnforcingSigner::new(if inbound {
273+
InMemorySigner::new(
274274
&secp_ctx,
275275
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ctr]).unwrap(),
276276
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, ctr]).unwrap(),
@@ -282,7 +282,7 @@ impl KeysInterface for KeyProvider {
282282
[0; 32]
283283
)
284284
} else {
285-
InMemoryChannelKeys::new(
285+
InMemorySigner::new(
286286
&secp_ctx,
287287
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, ctr]).unwrap(),
288288
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, ctr]).unwrap(),
@@ -302,8 +302,8 @@ impl KeysInterface for KeyProvider {
302302
(ctr >> 8*7) as u8, (ctr >> 8*6) as u8, (ctr >> 8*5) as u8, (ctr >> 8*4) as u8, (ctr >> 8*3) as u8, (ctr >> 8*2) as u8, (ctr >> 8*1) as u8, 14, (ctr >> 8*0) as u8]
303303
}
304304

305-
fn read_chan_signer(&self, data: &[u8]) -> Result<EnforcingChannelKeys, DecodeError> {
306-
EnforcingChannelKeys::read(&mut std::io::Cursor::new(data))
305+
fn read_chan_signer(&self, data: &[u8]) -> Result<EnforcingSigner, DecodeError> {
306+
EnforcingSigner::read(&mut std::io::Cursor::new(data))
307307
}
308308
}
309309

fuzz/src/utils/test_persister.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
use lightning::chain::channelmonitor;
22
use lightning::chain::transaction::OutPoint;
3-
use lightning::util::enforcing_trait_impls::EnforcingChannelKeys;
3+
use lightning::util::enforcing_trait_impls::EnforcingSigner;
44

55
pub struct TestPersister {}
6-
impl channelmonitor::Persist<EnforcingChannelKeys> for TestPersister {
7-
fn persist_new_channel(&self, _funding_txo: OutPoint, _data: &channelmonitor::ChannelMonitor<EnforcingChannelKeys>) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
6+
impl channelmonitor::Persist<EnforcingSigner> for TestPersister {
7+
fn persist_new_channel(&self, _funding_txo: OutPoint, _data: &channelmonitor::ChannelMonitor<EnforcingSigner>) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
88
Ok(())
99
}
1010

11-
fn update_persisted_channel(&self, _funding_txo: OutPoint, _update: &channelmonitor::ChannelMonitorUpdate, _data: &channelmonitor::ChannelMonitor<EnforcingChannelKeys>) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
11+
fn update_persisted_channel(&self, _funding_txo: OutPoint, _update: &channelmonitor::ChannelMonitorUpdate, _data: &channelmonitor::ChannelMonitor<EnforcingSigner>) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
1212
Ok(())
1313
}
1414
}

lightning-net-tokio/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
//! type Logger = dyn lightning::util::logger::Logger;
3737
//! type ChainAccess = dyn lightning::chain::Access;
3838
//! type ChainFilter = dyn lightning::chain::Filter;
39-
//! type DataPersister = dyn lightning::chain::channelmonitor::Persist<lightning::chain::keysinterface::InMemoryChannelKeys>;
40-
//! type ChainMonitor = lightning::chain::chainmonitor::ChainMonitor<lightning::chain::keysinterface::InMemoryChannelKeys, Arc<ChainFilter>, Arc<TxBroadcaster>, Arc<FeeEstimator>, Arc<Logger>, Arc<DataPersister>>;
39+
//! type DataPersister = dyn lightning::chain::channelmonitor::Persist<lightning::chain::keysinterface::InMemoryChannelSigner>;
40+
//! type ChainMonitor = lightning::chain::chainmonitor::ChainMonitor<lightning::chain::keysinterface::InMemoryChannelSigner, Arc<ChainFilter>, Arc<TxBroadcaster>, Arc<FeeEstimator>, Arc<Logger>, Arc<DataPersister>>;
4141
//! type ChannelManager = lightning::ln::channelmanager::SimpleArcChannelManager<ChainMonitor, TxBroadcaster, FeeEstimator, Logger>;
4242
//! type PeerManager = lightning::ln::peer_handler::SimpleArcPeerManager<lightning_net_tokio::SocketDescriptor, ChainMonitor, TxBroadcaster, FeeEstimator, ChainAccess, Logger>;
4343
//!

lightning-persister/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern crate libc;
55
use bitcoin::hashes::hex::ToHex;
66
use lightning::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateErr};
77
use lightning::chain::channelmonitor;
8-
use lightning::chain::keysinterface::ChannelKeys;
8+
use lightning::chain::keysinterface::Sign;
99
use lightning::chain::transaction::OutPoint;
1010
use lightning::util::ser::Writeable;
1111
use std::fs;
@@ -45,7 +45,7 @@ trait DiskWriteable {
4545
fn write(&self, writer: &mut fs::File) -> Result<(), Error>;
4646
}
4747

48-
impl<ChanSigner: ChannelKeys> DiskWriteable for ChannelMonitor<ChanSigner> {
48+
impl<ChanSigner: Sign> DiskWriteable for ChannelMonitor<ChanSigner> {
4949
fn write(&self, writer: &mut fs::File) -> Result<(), Error> {
5050
Writeable::write(self, writer)
5151
}
@@ -97,7 +97,7 @@ impl FilesystemPersister {
9797

9898
#[cfg(test)]
9999
fn load_channel_data<Keys: KeysInterface>(&self, keys: &Keys) ->
100-
Result<HashMap<OutPoint, ChannelMonitor<Keys::ChanKeySigner>>, ChannelMonitorUpdateErr> {
100+
Result<HashMap<OutPoint, ChannelMonitor<Keys::Signer>>, ChannelMonitorUpdateErr> {
101101
if let Err(_) = fs::create_dir_all(&self.path_to_channel_data) {
102102
return Err(ChannelMonitorUpdateErr::PermanentFailure);
103103
}
@@ -120,7 +120,7 @@ impl FilesystemPersister {
120120
if contents.is_err() { return Err(ChannelMonitorUpdateErr::PermanentFailure); }
121121

122122
if let Ok((_, loaded_monitor)) =
123-
<(BlockHash, ChannelMonitor<Keys::ChanKeySigner>)>::read(&mut Cursor::new(&contents.unwrap()), keys) {
123+
<(BlockHash, ChannelMonitor<Keys::Signer>)>::read(&mut Cursor::new(&contents.unwrap()), keys) {
124124
res.insert(OutPoint { txid: txid.unwrap(), index: index.unwrap() }, loaded_monitor);
125125
} else {
126126
return Err(ChannelMonitorUpdateErr::PermanentFailure);
@@ -130,7 +130,7 @@ impl FilesystemPersister {
130130
}
131131
}
132132

133-
impl<ChanSigner: ChannelKeys + Send + Sync> channelmonitor::Persist<ChanSigner> for FilesystemPersister {
133+
impl<ChanSigner: Sign + Send + Sync> channelmonitor::Persist<ChanSigner> for FilesystemPersister {
134134
fn persist_new_channel(&self, funding_txo: OutPoint, monitor: &ChannelMonitor<ChanSigner>) -> Result<(), ChannelMonitorUpdateErr> {
135135
self.write_channel_data(funding_txo, monitor)
136136
.map_err(|_| ChannelMonitorUpdateErr::PermanentFailure)

0 commit comments

Comments
 (0)