mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-05-10 02:30:15 +02:00
sdk: wot knows its size.
This commit is contained in:
parent
4705719c76
commit
72eeabd2f4
@ -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))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user