discovery: pass banThreshold to banman

So we can configure it via gossip's config in a following commit.
This commit is contained in:
yyforyongyu committed 2025-08-04 15:44:35 +08:00
1 parent 343418cfdf
commit 3109a8f3fe
3 files changed
+17 -12

No files matched your search

+4 -2
View File
@@ -12,12 +12,14 @@ import (
func TestPurgeBanEntries(t *testing.T) {
t.Parallel()
b := newBanman()
testBanThreshold := uint64(10)
b := newBanman(testBanThreshold)
// Ban a peer by repeatedly incrementing its ban score.
peer1 := [33]byte{0x00}
for i := 0; i < banThreshold; i++ {
for range testBanThreshold {
b.incrementBanScore(peer1)
}