mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-17 21:32:56 +01:00
rename option pool.WithQueryMiddleware() to pool.WithAuthorKindQueryMiddleware().
This commit is contained in:
parent
668720f4bc
commit
b33cfb19fa
6
pool.go
6
pool.go
@ -123,9 +123,9 @@ func (h WithEventMiddleware) ApplyPoolOption(pool *SimplePool) {
|
||||
|
||||
// WithQueryMiddleware is a function that will be called with every combination of relay+pubkey+kind queried
|
||||
// in a .SubMany*() call -- when applicable (i.e. when the query contains a pubkey and a kind).
|
||||
type WithQueryMiddleware func(relay string, pubkey string, kind int)
|
||||
type WithAuthorKindQueryMiddleware func(relay string, pubkey string, kind int)
|
||||
|
||||
func (h WithQueryMiddleware) ApplyPoolOption(pool *SimplePool) {
|
||||
func (h WithAuthorKindQueryMiddleware) ApplyPoolOption(pool *SimplePool) {
|
||||
pool.queryMiddleware = h
|
||||
}
|
||||
|
||||
@ -508,7 +508,7 @@ func (pool *SimplePool) CountMany(
|
||||
filter Filter,
|
||||
opts []SubscriptionOption,
|
||||
) int {
|
||||
hll := hyperloglog.New(0) // offset is irrelevant here, so we just pass 0
|
||||
hll := hyperloglog.New(0) // offset is irrelevant here
|
||||
|
||||
wg := sync.WaitGroup{}
|
||||
wg.Add(len(urls))
|
||||
|
@ -106,7 +106,7 @@ func NewSystem(mods ...SystemModifier) *System {
|
||||
}
|
||||
|
||||
sys.Pool = nostr.NewSimplePool(context.Background(),
|
||||
nostr.WithQueryMiddleware(sys.TrackQueryAttempts),
|
||||
nostr.WithAuthorKindQueryMiddleware(sys.TrackQueryAttempts),
|
||||
nostr.WithEventMiddleware(sys.TrackEventHints),
|
||||
nostr.WithPenaltyBox(),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user