aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisper.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-11-18 00:33:25 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-11-27 17:06:12 +0800
commit1e806c4c775bd98b224eb0249007502d348e737b (patch)
treea34bfcac320df6f65e73eb1578b212289be86b5f /whisper/whisper.go
parent8a44451edfa36ea40da564a2fa7ea905d45440a4 (diff)
downloaddexon-1e806c4c775bd98b224eb0249007502d348e737b.tar
dexon-1e806c4c775bd98b224eb0249007502d348e737b.tar.gz
dexon-1e806c4c775bd98b224eb0249007502d348e737b.tar.bz2
dexon-1e806c4c775bd98b224eb0249007502d348e737b.tar.lz
dexon-1e806c4c775bd98b224eb0249007502d348e737b.tar.xz
dexon-1e806c4c775bd98b224eb0249007502d348e737b.tar.zst
dexon-1e806c4c775bd98b224eb0249007502d348e737b.zip
cmd, common, core, eth, node, rpc, tests, whisper, xeth: use protocol stacks
Diffstat (limited to 'whisper/whisper.go')
-rw-r--r--whisper/whisper.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/whisper/whisper.go b/whisper/whisper.go
index a341f23e4..7201062b8 100644
--- a/whisper/whisper.go
+++ b/whisper/whisper.go
@@ -98,9 +98,9 @@ func New() *Whisper {
return whisper
}
-// Protocol returns the whisper sub-protocol handler for this particular client.
-func (self *Whisper) Protocol() p2p.Protocol {
- return self.protocol
+// Protocols returns the whisper sub-protocols ran by this particular client.
+func (self *Whisper) Protocols() []p2p.Protocol {
+ return []p2p.Protocol{self.protocol}
}
// Version returns the whisper sub-protocols version number.
@@ -156,14 +156,20 @@ func (self *Whisper) Send(envelope *Envelope) error {
return self.add(envelope)
}
-func (self *Whisper) Start() {
+// Start implements node.Service, starting the background data propagation thread
+// of the Whisper protocol.
+func (self *Whisper) Start(*p2p.Server) error {
glog.V(logger.Info).Infoln("Whisper started")
go self.update()
+ return nil
}
-func (self *Whisper) Stop() {
+// Stop implements node.Service, stopping the background data propagation thread
+// of the Whisper protocol.
+func (self *Whisper) Stop() error {
close(self.quit)
glog.V(logger.Info).Infoln("Whisper stopped")
+ return nil
}
// Messages retrieves all the currently pooled messages matching a filter id.