summaryrefslogtreecommitdiffhomepage
path: root/src/routing.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-06-24 15:34:17 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-06-24 15:34:44 +0200
commit25190e43369a79dc77a740dc8cd28b8a9fcb235e (patch)
treeb7057627e0710fe9ef40c077a204904c78bed9cc /src/routing.go
parent521e77fd54fba275405affd790ac91f7998e4559 (diff)
Restructuring of noise impl.
Diffstat (limited to 'src/routing.go')
-rw-r--r--src/routing.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/routing.go b/src/routing.go
index 0aa111c..553df11 100644
--- a/src/routing.go
+++ b/src/routing.go
@@ -13,6 +13,13 @@ type RoutingTable struct {
mutex sync.RWMutex
}
+func (table *RoutingTable) Reset() {
+ table.mutex.Lock()
+ defer table.mutex.Unlock()
+ table.IPv4 = nil
+ table.IPv6 = nil
+}
+
func (table *RoutingTable) RemovePeer(peer *Peer) {
table.mutex.Lock()
defer table.mutex.Unlock()