+ fn on_accept(&mut self, channel_points: &ChannelPublicKeys, counterparty_selected_contest_delay: u16, holder_selected_contest_delay: u16);
+}
+
+/// A trait to describe an object which can get user secrets and key material.
+pub trait KeysInterface: Send + Sync {
+ /// A type which implements ChannelKeys which will be returned by get_channel_keys.
+ type ChanKeySigner : ChannelKeys;
+
+ /// Get node secret key (aka node_id or network_key)
+ fn get_node_secret(&self) -> SecretKey;
+ /// Get destination redeemScript to encumber static protocol exit points.
+ fn get_destination_script(&self) -> Script;
+ /// Get shutdown_pubkey to use as PublicKey at channel closure
+ fn get_shutdown_pubkey(&self) -> PublicKey;
+ /// Get a new set of ChannelKeys for per-channel secrets. These MUST be unique even if you
+ /// restarted with some stale data!
+ fn get_channel_keys(&self, inbound: bool, channel_value_satoshis: u64) -> Self::ChanKeySigner;
+ /// Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
+ /// onion packets and for temporary channel IDs. There is no requirement that these be
+ /// persisted anywhere, though they must be unique across restarts.
+ fn get_secure_random_bytes(&self) -> [u8; 32];
+}
+
+#[derive(Clone)]
+/// Holds late-bound channel data.
+/// This data is available after the channel is known to be accepted, either
+/// when receiving an open_channel for an inbound channel or when
+/// receiving accept_channel for an outbound channel.
+struct AcceptedChannelData {
+ /// Counterparty public keys and base points
+ counterparty_channel_pubkeys: ChannelPublicKeys,
+ /// The contest_delay value specified by our counterparty and applied on holder-broadcastable
+ /// transactions, ie the amount of time that we have to wait to recover our funds if we
+ /// broadcast a transaction. You'll likely want to pass this to the
+ /// ln::chan_utils::build*_transaction functions when signing holder's transactions.
+ counterparty_selected_contest_delay: u16,
+ /// The contest_delay value specified by us and applied on transactions broadcastable
+ /// by our counterparty, ie the amount of time that they have to wait to recover their funds
+ /// if they broadcast a transaction.
+ holder_selected_contest_delay: u16,