Skip to content
Snippets Groups Projects
Commit 892d5285 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Merge branch 'XX-2828/authchan' of gitlab.com:elixxir/client into XX-2828/authchan

parents e770a0b1 6006b693
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,9 @@ import ( ...@@ -34,6 +34,9 @@ import (
"time" "time"
) )
const bloomFilterSize = 71888 // In Bits
const bloomFilterHashes = 8
//comms interface makes testing easier //comms interface makes testing easier
type followNetworkComms interface { type followNetworkComms interface {
GetHost(hostId *id.ID) (*connect.Host, bool) GetHost(hostId *id.ID) (*connect.Host, bool)
...@@ -99,7 +102,10 @@ func (m *manager) follow(rng csprng.Source, comms followNetworkComms) { ...@@ -99,7 +102,10 @@ func (m *manager) follow(rng csprng.Source, comms followNetworkComms) {
var filterList []*bloom.Ring var filterList []*bloom.Ring
for _, f := range pollResp.BloomFilters { for _, f := range pollResp.BloomFilters {
jww.INFO.Printf("Bloom Filter received: %v", f) jww.INFO.Printf("Bloom Filter received: %v", f)
filter := &bloom.Ring{} filter, err := bloom.InitByParameters(bloomFilterSize, bloomFilterHashes)
if err != nil {
jww.FATAL.Panicf("Unable to create a bloom filter: %v", err)
}
if err := filter.UnmarshalBinary(f); err != nil { if err := filter.UnmarshalBinary(f); err != nil {
jww.WARN.Printf("Failed to unmarshal filter: %+v", err) jww.WARN.Printf("Failed to unmarshal filter: %+v", err)
continue continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment