]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Drop verification context from keys manager
authorMatt Corallo <git@bluematt.me>
Wed, 16 Jan 2019 20:45:28 +0000 (15:45 -0500)
committerMatt Corallo <git@bluematt.me>
Tue, 22 Jan 2019 18:49:15 +0000 (13:49 -0500)
src/chain/keysinterface.rs

index 3e41f9e9b484794b13ca9db1c2cb747302e51492..53191faf2c9162e75db69661dec3aec483c76a50 100644 (file)
@@ -116,7 +116,7 @@ impl_writeable!(ChannelKeys, 0, {
 /// Cooperative closes may use seed/2'
 /// The two close keys may be needed to claim on-chain funds!
 pub struct KeysManager {
-       secp_ctx: Secp256k1<secp256k1::All>,
+       secp_ctx: Secp256k1<secp256k1::SignOnly>,
        node_secret: SecretKey,
        destination_script: Script,
        shutdown_pubkey: PublicKey,
@@ -132,7 +132,7 @@ impl KeysManager {
        /// Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
        /// RNG is busted) this may panic.
        pub fn new(seed: &[u8; 32], network: Network, logger: Arc<Logger>) -> KeysManager {
-               let secp_ctx = Secp256k1::new();
+               let secp_ctx = Secp256k1::signing_only();
                match ExtendedPrivKey::new_master(network.clone(), seed) {
                        Ok(master_key) => {
                                let node_secret = master_key.ckd_priv(&secp_ctx, ChildNumber::from_hardened_idx(0)).expect("Your RNG is busted").secret_key;