From 029f839be5657e1d15b8c9341e3ac95aee735a1c Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Thu, 30 Sep 2021 00:26:56 +1000 Subject: [PATCH] treaty: prevent networking loops --- pkg/garden/app/treaty.hoon | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/garden/app/treaty.hoon b/pkg/garden/app/treaty.hoon index 4440596ae..c014c5a73 100644 --- a/pkg/garden/app/treaty.hoon +++ b/pkg/garden/app/treaty.hoon @@ -196,9 +196,13 @@ ++ take-treaty |= =desk ?+ -.sign (on-agent:def wire sign) + :: + :: rewatch only if we aren't source + :: this would cause a potential kick-rewatch loop otherwise :: %kick :_ this + ?: =(our.bowl src.bowl) ~ ~(watch tr:cc ship desk)^~ :: %watch-ack @@ -292,7 +296,7 @@ ++ dock [ship dap.bowl] ++ watch (watch:pass dock path) ++ watching (~(has by wex.bowl) [path dock]) - ++ safe-watch `(unit card)`?:(watching ~ `watch) + ++ safe-watch `(unit card)`?:(|(watching =(our.bowl ship)) ~ `watch) ++ leave (leave:pass dock) ++ give =/ t=treaty (~(got by treaties) ship desk)