diff options
author | gluk256 <gluk256@users.noreply.github.com> | 2018-01-12 19:11:22 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-01-12 19:11:22 +0800 |
commit | fd869dc839e2b3696e130224a43b9b25455ceb46 (patch) | |
tree | f19c5db8acac542f451cceac216333f7a75a2ef5 /whisper/whisperv6/api.go | |
parent | 56152b31ac251d1cc68fcddbdad159ba5234c415 (diff) | |
download | dexon-fd869dc839e2b3696e130224a43b9b25455ceb46.tar dexon-fd869dc839e2b3696e130224a43b9b25455ceb46.tar.gz dexon-fd869dc839e2b3696e130224a43b9b25455ceb46.tar.bz2 dexon-fd869dc839e2b3696e130224a43b9b25455ceb46.tar.lz dexon-fd869dc839e2b3696e130224a43b9b25455ceb46.tar.xz dexon-fd869dc839e2b3696e130224a43b9b25455ceb46.tar.zst dexon-fd869dc839e2b3696e130224a43b9b25455ceb46.zip |
whisper/whisperv6: implement pow/bloom exchange protocol (#15802)
This is the main feature of v6.
Diffstat (limited to 'whisper/whisperv6/api.go')
-rw-r--r-- | whisper/whisperv6/api.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go index 3dddb6953..0e8490b41 100644 --- a/whisper/whisperv6/api.go +++ b/whisper/whisperv6/api.go @@ -116,12 +116,17 @@ func (api *PublicWhisperAPI) SetMaxMessageSize(ctx context.Context, size uint32) return true, api.w.SetMaxMessageSize(size) } -// SetMinPow sets the minimum PoW for a message before it is accepted. +// SetMinPow sets the minimum PoW, and notifies the peers. func (api *PublicWhisperAPI) SetMinPoW(ctx context.Context, pow float64) (bool, error) { return true, api.w.SetMinimumPoW(pow) } -// MarkTrustedPeer marks a peer trusted. , which will allow it to send historic (expired) messages. +// SetBloomFilter sets the new value of bloom filter, and notifies the peers. +func (api *PublicWhisperAPI) SetBloomFilter(ctx context.Context, bloom hexutil.Bytes) (bool, error) { + return true, api.w.SetBloomFilter(bloom) +} + +// MarkTrustedPeer marks a peer trusted, which will allow it to send historic (expired) messages. // Note: This function is not adding new nodes, the node needs to exists as a peer. func (api *PublicWhisperAPI) MarkTrustedPeer(ctx context.Context, enode string) (bool, error) { n, err := discover.ParseNode(enode) |