Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
refactor: disable crude rate-limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc committed Aug 30, 2019
1 parent cf76de1 commit 55b4862
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions wantmanager/wantmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,21 +248,21 @@ func (ws *wantSet) handle(wm *WantManager) {
// it separately here
// TODO: handle disconnects
// TODO: handle dups
for _, e := range ws.entries {
if e.WantType == wantlist.WantType_Block {
for _, p := range ws.targets {
if _, ok := wm.peerCounts[p]; !ok {
wm.peerCounts[p] = 0
}
if e.Cancel {
// TODO: handle cancel-block (it's a broadcast to all peers so won't get decremented here)
wm.peerCounts[p]--
} else {
wm.peerCounts[p]++
}
}
}
}
// for _, e := range ws.entries {
// if e.WantType == wantlist.WantType_Block {
// for _, p := range ws.targets {
// if _, ok := wm.peerCounts[p]; !ok {
// wm.peerCounts[p] = 0
// }
// if e.Cancel {
// // TODO: handle cancel-block (it's a broadcast to all peers so won't get decremented here)
// wm.peerCounts[p]--
// } else {
// wm.peerCounts[p]++
// }
// }
// }
// }

// for p, c := range wm.peerCounts {
// log.Warningf("want-manager: %s live = %d", p, c)
Expand Down

0 comments on commit 55b4862

Please sign in to comment.