Skip to content

Commit

Permalink
update walletmetadata hashable to allow multiple copies of the same t…
Browse files Browse the repository at this point in the history
…o exist, so long as its not also a child and or watch wallet
  • Loading branch information
simonmcl committed Jan 22, 2024
1 parent 9af31bf commit 6a7d1f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/KukaiCoreSwift/Models/WalletMetadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,14 @@ public struct WalletMetadata: Codable, Hashable {
}

public static func == (lhs: WalletMetadata, rhs: WalletMetadata) -> Bool {
return lhs.address == rhs.address
return lhs.address == rhs.address &&
lhs.isChild == rhs.isChild &&
lhs.isWatchOnly == rhs.isWatchOnly
}

public func hash(into hasher: inout Hasher) {
hasher.combine(address)
hasher.combine(isChild)
hasher.combine(isWatchOnly)
}
}

0 comments on commit 6a7d1f9

Please sign in to comment.