private void SetupSomeSilent(int n, int f, ICollection <int> silentId)
        {
            SetUp(n, f);
            var cnt = 0;

            while (cnt < f)
            {
                var x = _rnd.Next(n);
                if (x == 0)
                {
                    continue;
                }
                if (_broadcasts[x] != null)
                {
                    continue;
                }
                _broadcasts[x] = new SilentProtocol <ReliableBroadcastId>(new ReliableBroadcastId(0, 0));
                silentId.Add(x);
                ++cnt;
            }

            for (uint i = 0; i < n; ++i)
            {
                _broadcasts[i] ??=
                new ReliableBroadcast(new ReliableBroadcastId(Sender, 0), _publicKeys, _broadcasters[i]);
                _broadcasters[i].RegisterProtocols(new[] { _broadcasts[i], _resultInterceptors[i] });
            }
        }
Beispiel #2
0
        private void SetupSomeSilent(int n, int f)
        {
            SetUp(n, f);
            var cnt = 0;

            while (cnt < f)
            {
                var x = _rnd.Next(n);
                if (_broadcasts[x] != null)
                {
                    continue;
                }
                _broadcasts[x] = new SilentProtocol <BinaryBroadcastId>(new BinaryBroadcastId(0, 0, 0));
                ++cnt;
            }

            for (uint i = 0; i < n; ++i)
            {
                _broadcasts[i] ??= new BinaryBroadcast(new BinaryBroadcastId(0, 0, 0), _publicKeys, _broadcasters[i]);
                _broadcasters[i].RegisterProtocols(new[] { _broadcasts[i], _resultInterceptors[i] });
            }
        }