Skip to content

Commit 17c8976

Browse files
committed
Prune acceptFromWhitelist in _removePeer
1 parent 41d12bf commit 17c8976

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

test/accept-from.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ const {
88

99
describe('Gossipsub acceptFrom', () => {
1010
let gossipsub
11-
const sandbox = sinon.createSandbox()
11+
let sandbox
1212
let scoreStub
1313

1414
beforeEach(async () => {
15+
sandbox = sinon.createSandbox()
1516
sandbox.useFakeTimers()
1617
gossipsub = new Gossipsub(await createPeer({ started: false }), { emitSelf: true })
1718
scoreStub = sandbox.createStubInstance(PeerScore)

ts/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ class Gossipsub extends Pubsub {
390390
// Remove from peer scoring
391391
this.score.removePeer(id)
392392

393+
this.acceptFromWhitelist.delete(id)
394+
393395
return peerStreams
394396
}
395397

0 commit comments

Comments
 (0)