whisper: pow exchange and bloom exchange protocols implemented

This commit is contained in:
Vlad 2018-01-02 12:59:15 +02:00 committed by Guillaume Ballet
parent aef7580bea
commit 9ecbc535c7

View file

@ -273,6 +273,13 @@ func (w *Whisper) SetMinimumPowTest(val float64) {
w.settings.Store(minPowToleranceIdx, val) w.settings.Store(minPowToleranceIdx, val)
} }
// SetBloomFilterTest sets the Bloom Filter in test environment
func (w *Whisper) SetBloomFilterTest(bloom []byte) {
w.settings.Store(bloomFilterIdx, bloom)
w.notifyPeersAboutBloomFilterChange(bloom)
w.settings.Store(bloomFilterToleranceIdx, bloom)
}
func (w *Whisper) notifyPeersAboutPowRequirementChange(pow float64) { func (w *Whisper) notifyPeersAboutPowRequirementChange(pow float64) {
arr := w.getPeers() arr := w.getPeers()
for _, p := range arr { for _, p := range arr {