From c6f019f27144ed31753bf98fe4c256997cc6363f Mon Sep 17 00:00:00 2001 From: Rahix Date: Tue, 16 Apr 2019 22:37:06 +0200 Subject: [PATCH] No reannouncing self Signed-off-by: Rahix --- bc.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/bc.lua b/bc.lua index eea38bed2999..357b1fa69976 100644 --- a/bc.lua +++ b/bc.lua @@ -147,14 +147,17 @@ function BaseControl:finalize(waits, timeout) self = BaseControl:new() end - -- Announce own nouns and verbs - local nouns, verbs = self:nouns(true), self:verbs(true) - if #nouns > 0 or #verbs > 0 then - self.network:broadcast{ - ty=Message.Register, - nouns=nouns, - verbs=verbs, - } + -- Announce own nouns and verbs if this is the first + -- call to finalize() and we have registered names + if not self.live then + local nouns, verbs = self:nouns(true), self:verbs(true) + if #nouns > 0 or #verbs > 0 then + self.network:broadcast{ + ty=Message.Register, + nouns=nouns, + verbs=verbs, + } + end end if #(waits or {}) ~= 0 then