From: Evgenii P Date: Tue, 15 Dec 2020 04:33:33 +0000 (+0700) Subject: Fix SignersContainerKey PartialOrd to respect the ID X-Git-Tag: v0.2.0~16^2~3 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/-progress.html?a=commitdiff_plain;h=2658a9b05af1c68ecc9cc940ef9cbc2bb7301faa;p=bdk Fix SignersContainerKey PartialOrd to respect the ID --- diff --git a/src/wallet/signer.rs b/src/wallet/signer.rs index a2aba04f..2a201379 100644 --- a/src/wallet/signer.rs +++ b/src/wallet/signer.rs @@ -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)) } }