]> Untitled Git - bdk/commitdiff
Remove debug output
authorEvgenii P <eupn@protonmail.com>
Sun, 13 Dec 2020 17:22:06 +0000 (00:22 +0700)
committerEvgenii P <eupn@protonmail.com>
Sun, 13 Dec 2020 18:02:48 +0000 (01:02 +0700)
src/wallet/signer.rs

index 1b3904428c6f69bbf5775511a42be42f07bf2b09..9f158c56daac263f507c7cfcf94f58885524e899 100644 (file)
@@ -248,8 +248,6 @@ impl Signer for PrivateKey {
             return Err(SignerError::InputIndexOutOfRange);
         }
 
-        println!("Partial sigs: {:?}", psbt.inputs[input_index].partial_sigs);
-
         let pubkey = self.public_key(&secp);
         if psbt.inputs[input_index].partial_sigs.contains_key(&pubkey) {
             return Ok(());
@@ -341,7 +339,7 @@ impl From<KeyMap> for SignersContainer {
         let mut container = SignersContainer::new();
 
         for (_, secret) in keymap {
-            let previous = match secret {
+            match secret {
                 DescriptorSecretKey::SinglePriv(private_key) => container.add_external(
                     SignerId::from(
                         private_key
@@ -358,10 +356,6 @@ impl From<KeyMap> for SignersContainer {
                     Arc::new(xprv),
                 ),
             };
-
-            if let Some(previous) = previous {
-                println!("This signer was replaced: {:?}", previous)
-            }
         }
 
         container
@@ -375,20 +369,14 @@ impl SignersContainer {
     }
 
     /// Adds an external signer to the container for the specified id. Optionally returns the
-    /// signer that was previosuly in the container, if any
+    /// signer that was previously in the container, if any
     pub fn add_external(
         &mut self,
         id: SignerId,
         ordering: SignerOrdering,
         signer: Arc<dyn Signer>,
     ) -> Option<Arc<dyn Signer>> {
-
-        println!("Adding external signer ID = {:?}", id);
-        let key = (id, ordering).into();
-        println!("With a key: {:?}", key);
-        let res = self.0.insert(key, signer);
-        println!("After insertion, len = {}", self.0.values().len());
-        res
+        self.0.insert((id, ordering).into(), signer)
     }
 
     /// Removes a signer from the container and returns it
@@ -408,7 +396,6 @@ impl SignersContainer {
     pub fn signers(&self) -> Vec<&Arc<dyn Signer>> {
         let mut items = self.0.iter().collect::<Vec<_>>();
         items.sort_by(|(a, _), (b, _)| (*a).cmp(*b));
-
         items.into_iter().map(|(_, v)| v).collect()
     }