mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-08-23 12:12:04 +02:00
sdk: wot knows its size.
This commit is contained in:
@@ -149,13 +149,17 @@ func makeWoTFilter(m chan string) WotXorFilter {
|
||||
}
|
||||
|
||||
xf, _ := xorfilter.Populate(shids)
|
||||
return WotXorFilter{*xf}
|
||||
return WotXorFilter{len(shids), *xf}
|
||||
}
|
||||
|
||||
type WotXorFilter struct {
|
||||
Items int
|
||||
xorfilter.Xor8
|
||||
}
|
||||
|
||||
func (wxf WotXorFilter) Contains(pubkey string) bool {
|
||||
if wxf.Items == 0 {
|
||||
return false
|
||||
}
|
||||
return wxf.Xor8.Contains(PubKeyToShid(pubkey))
|
||||
}
|
||||
|
Reference in New Issue
Block a user