Skip to content

Commit 313ae3b

Browse files
authored
fix: do not rebroadcast want list (#225)
We should not need to rebroadcast our want lists, because we send it to newly connected peers. Rebroadcasting is a throwback to when the network was less reliable, but if the connection is unreliable it is dropped and a new connection established, which triggers sending the whole wantlist as the remote is seen as a newly connected peer. fixes #160
1 parent 3099606 commit 313ae3b

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

src/constants.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ module.exports = {
88
hasBlockTimeout: 15 * SECOND,
99
provideTimeout: 15 * SECOND,
1010
kMaxPriority: Math.pow(2, 31) - 1,
11-
rebroadcastDelay: 10 * SECOND,
1211
maxListeners: 1000
1312
}

src/want-manager/index.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,6 @@ module.exports = class WantManager {
112112
}
113113

114114
start () {
115-
// resend entire wantlist every so often
116-
this.timer = setInterval(() => {
117-
this._log('resend full-wantlist')
118-
const fullwantlist = new Message(true)
119-
this.wantlist.forEach((entry) => {
120-
fullwantlist.addEntry(entry.cid, entry.priority)
121-
})
122-
123-
this.peers.forEach((p) => p.addMessage(fullwantlist))
124-
}, 60 * 1000)
125115
}
126116

127117
stop () {

0 commit comments

Comments
 (0)