+ /// Seed from which all randomness produced is derived from.
+ rand_bytes_unique_start: [u8; 32],
+ /// Tracks the number of times we've produced randomness to ensure we don't return the same
+ /// bytes twice.
+ rand_bytes_index: AtomicCounter,
+}
+
+impl Clone for InMemorySigner {
+ fn clone(&self) -> Self {
+ Self {
+ funding_key: self.funding_key.clone(),
+ revocation_base_key: self.revocation_base_key.clone(),
+ payment_key: self.payment_key.clone(),
+ delayed_payment_base_key: self.delayed_payment_base_key.clone(),
+ htlc_base_key: self.htlc_base_key.clone(),
+ commitment_seed: self.commitment_seed.clone(),
+ holder_channel_pubkeys: self.holder_channel_pubkeys.clone(),
+ channel_parameters: self.channel_parameters.clone(),
+ channel_value_satoshis: self.channel_value_satoshis,
+ channel_keys_id: self.channel_keys_id,
+ rand_bytes_unique_start: self.get_secure_random_bytes(),
+ rand_bytes_index: AtomicCounter::new(),
+ }
+ }