diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go index f11e8b6dca..0e8490b419 100644 --- a/whisper/whisperv6/api.go +++ b/whisper/whisperv6/api.go @@ -113,29 +113,17 @@ func (api *PublicWhisperAPI) Info(ctx context.Context) Info { // SetMaxMessageSize sets the maximum message size that is accepted. // Upper limit is defined by MaxMessageSize. func (api *PublicWhisperAPI) SetMaxMessageSize(ctx context.Context, size uint32) (bool, error) { - err := api.w.SetMaxMessageSize(size) - if err != nil { - return false, err - } - return true, nil + return true, api.w.SetMaxMessageSize(size) } // SetMinPow sets the minimum PoW, and notifies the peers. func (api *PublicWhisperAPI) SetMinPoW(ctx context.Context, pow float64) (bool, error) { - err := api.w.SetMinimumPoW(pow) - if err != nil { - return false, err - } - return true, nil + return true, api.w.SetMinimumPoW(pow) } // SetBloomFilter sets the new value of bloom filter, and notifies the peers. func (api *PublicWhisperAPI) SetBloomFilter(ctx context.Context, bloom hexutil.Bytes) (bool, error) { - err := api.w.SetBloomFilter(bloom) - if err != nil { - return false, err - } - return true, nil + return true, api.w.SetBloomFilter(bloom) } // MarkTrustedPeer marks a peer trusted, which will allow it to send historic (expired) messages. diff --git a/whisper/whisperv6/whisper.go b/whisper/whisperv6/whisper.go index e4fb273005..bc89aadccd 100644 --- a/whisper/whisperv6/whisper.go +++ b/whisper/whisperv6/whisper.go @@ -1067,12 +1067,3 @@ func addBloom(a, b []byte) []byte { } return c } - -func isBloomFilterEqual(a, b []byte) bool { - for i := 0; i < bloomFilterSize; i++ { - if a[i] != b[i] { - return false - } - } - return true -}