summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArlo Breault <arlolra@gmail.com>2015-03-27 13:14:09 -0700
committerArlo Breault <arlolra@gmail.com>2015-03-27 13:14:09 -0700
commitf506e69362cf9bd38f5a823cbdf7c0da585b12e7 (patch)
tree2c064b1918513c746ae94bff6a0e37c216179288
parentad424311980e22d49b4e99aa00fa1c5c584adfe2 (diff)
Dedup text/plain bulk exit list
* These duplicates are a result of trac 10499 but, in general, the authorities do allow up to two relays to exit from the same ip. * Closes trac 15480
-rw-r--r--datastore.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/datastore.go b/datastore.go
index 34106a6..4ce9516 100644
--- a/datastore.go
+++ b/datastore.go
@@ -130,8 +130,12 @@ type Exits struct {
func (e *Exits) Dump(w io.Writer, tminus int, ip string, port int) {
ap := AddressPort{ip, port}
+ var last string
e.GetAllExits(ap, tminus, func(exit string, _ string, _ int) {
- w.Write([]byte(exit + "\n"))
+ if exit != last {
+ w.Write([]byte(exit + "\n"))
+ last = exit
+ }
})
}