- /// Get a secret and PRNG seed for constructing an onion packet
- fn get_onion_rand(&self) -> (SecretKey, [u8; 32]);
- /// Get a unique temporary channel id. Channels will be referred to by this until the funding
- /// transaction is created, at which point they will use the outpoint in the funding
- /// transaction.
- fn get_channel_id(&self) -> [u8; 32];
+ /// 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,