We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cecbe9a commit c7977d1Copy full SHA for c7977d1
src/core/bip32/primitives.rs
@@ -24,6 +24,10 @@ impl From<[u8; 4]> for KeyFingerprint {
24
}
25
26
impl KeyFingerprint {
27
+ pub fn is_zero(&self) -> bool {
28
+ self.0.iter().all(|b| *b == 0)
29
+ }
30
+
31
/// Determines if the slice represents the same key fingerprint
32
pub fn eq_slice(self, other: &[u8]) -> bool {
33
self.0 == other
src/core/user/wallet.rs
@@ -219,7 +219,7 @@ impl Wallet {
219
220
221
pub fn is_master(&self) -> bool {
222
- self.xkey_info.as_ref().map(|info| info.index == 0).unwrap_or(false)
+ self.xkey_info.as_ref().map(|info| info.parent.is_zero()).unwrap_or(false)
223
224
225
pub fn is_hardened(&self) -> bool {
0 commit comments