|
|
@ -249,7 +249,10 @@ func (whisper *Whisper) SetBloomFilter(bloom []byte) error { |
|
|
|
go func() { |
|
|
|
go func() { |
|
|
|
// allow some time before all the peers have processed the notification
|
|
|
|
// allow some time before all the peers have processed the notification
|
|
|
|
defer whisper.wg.Done() |
|
|
|
defer whisper.wg.Done() |
|
|
|
time.Sleep(time.Duration(whisper.syncAllowance) * time.Second) |
|
|
|
ticker := time.NewTicker(time.Duration(whisper.syncAllowance) * time.Second) |
|
|
|
|
|
|
|
defer ticker.Stop() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<-ticker.C |
|
|
|
whisper.settings.Store(bloomFilterToleranceIdx, b) |
|
|
|
whisper.settings.Store(bloomFilterToleranceIdx, b) |
|
|
|
}() |
|
|
|
}() |
|
|
|
|
|
|
|
|
|
|
@ -269,7 +272,10 @@ func (whisper *Whisper) SetMinimumPoW(val float64) error { |
|
|
|
go func() { |
|
|
|
go func() { |
|
|
|
defer whisper.wg.Done() |
|
|
|
defer whisper.wg.Done() |
|
|
|
// allow some time before all the peers have processed the notification
|
|
|
|
// allow some time before all the peers have processed the notification
|
|
|
|
time.Sleep(time.Duration(whisper.syncAllowance) * time.Second) |
|
|
|
ticker := time.NewTicker(time.Duration(whisper.syncAllowance) * time.Second) |
|
|
|
|
|
|
|
defer ticker.Stop() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<-ticker.C |
|
|
|
whisper.settings.Store(minPowToleranceIdx, val) |
|
|
|
whisper.settings.Store(minPowToleranceIdx, val) |
|
|
|
}() |
|
|
|
}() |
|
|
|
|
|
|
|
|
|
|
|