]> Untitled Git - bdk/commitdiff
Fix SignersContainerKey PartialOrd to respect the ID
authorEvgenii P <eupn@protonmail.com>
Tue, 15 Dec 2020 04:33:33 +0000 (11:33 +0700)
committerEvgenii P <eupn@protonmail.com>
Tue, 15 Dec 2020 04:36:26 +0000 (11:36 +0700)
src/wallet/signer.rs

index a2aba04fbab7544b51ff4c2eaadd19ad63003c51..2a2013795a81cba565084acca232d55751923d41 100644 (file)
@@ -112,7 +112,7 @@ use crate::descriptor::XKeyUtils;
 
 /// Identifier of a signer in the `SignersContainers`. Used as a key to find the right signer among
 /// multiple of them
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, Ord, PartialOrd, PartialEq, Eq, Hash)]
 pub enum SignerId {
     PkHash(hash160::Hash),
     Fingerprint(Fingerprint),
@@ -522,7 +522,7 @@ impl PartialOrd for SignersContainerKey {
 
 impl Ord for SignersContainerKey {
     fn cmp(&self, other: &Self) -> Ordering {
-        self.ordering.cmp(&other.ordering)
+        self.ordering.cmp(&other.ordering).then(self.id.cmp(&other.id))
     }
 }