p2p/discover: add node expirer and related tests

This commit is contained in:
Péter Szilágyi
2015-04-27 17:38:28 +03:00
parent a136e2bb22
commit 437cf4b3ac
3 changed files with 116 additions and 4 deletions

View File

@ -335,6 +335,8 @@ func (tab *Table) ping(id NodeID, addr *net.UDPAddr) error {
}
// Pong received, update the database and return
tab.db.updateLastPong(id, time.Now())
go tab.db.expirer()
return nil
}