From 72eeabd2f44fb862f06d77f932f632b19703cf7d Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 4 Apr 2025 14:32:08 -0300 Subject: [PATCH] sdk: wot knows its size. --- sdk/wot.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/wot.go b/sdk/wot.go index a6acf14..1f527fd 100644 --- a/sdk/wot.go +++ b/sdk/wot.go @@ -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)) }