aboutsummaryrefslogtreecommitdiffstats
path: root/whisper
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-04-17 21:45:44 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-04-28 15:47:35 +0800
commit3563c59b12b0b8b5fd15847bf97d71dfd8416207 (patch)
treef059a2bcbd7edb25c595bbad30514828fc1a5282 /whisper
parent182d484aa70bcd5b22117f02333b1fd3b1535dcb (diff)
downloadgo-tangerine-3563c59b12b0b8b5fd15847bf97d71dfd8416207.tar
go-tangerine-3563c59b12b0b8b5fd15847bf97d71dfd8416207.tar.gz
go-tangerine-3563c59b12b0b8b5fd15847bf97d71dfd8416207.tar.bz2
go-tangerine-3563c59b12b0b8b5fd15847bf97d71dfd8416207.tar.lz
go-tangerine-3563c59b12b0b8b5fd15847bf97d71dfd8416207.tar.xz
go-tangerine-3563c59b12b0b8b5fd15847bf97d71dfd8416207.tar.zst
go-tangerine-3563c59b12b0b8b5fd15847bf97d71dfd8416207.zip
rpc, whisper, xeth: polish whisper RPC interface
Diffstat (limited to 'whisper')
-rw-r--r--whisper/whisper.go13
1 files changed, 3 insertions, 10 deletions
diff --git a/whisper/whisper.go b/whisper/whisper.go
index 9317fad50..59a1a63c4 100644
--- a/whisper/whisper.go
+++ b/whisper/whisper.go
@@ -58,6 +58,8 @@ type Whisper struct {
quit chan struct{}
}
+// New creates a Whisper client ready to communicate through the Ethereum P2P
+// network.
func New() *Whisper {
whisper := &Whisper{
filters: filter.New(),
@@ -148,7 +150,7 @@ func (self *Whisper) Stop() {
glog.V(logger.Info).Infoln("Whisper stopped")
}
-// Messages retrieves the currently pooled messages matching a filter id.
+// Messages retrieves all the currently pooled messages matching a filter id.
func (self *Whisper) Messages(id int) []*Message {
messages := make([]*Message, 0)
if filter := self.filters.Get(id); filter != nil {
@@ -163,15 +165,6 @@ func (self *Whisper) Messages(id int) []*Message {
return messages
}
-// func (self *Whisper) RemoveIdentity(key *ecdsa.PublicKey) bool {
-// k := string(crypto.FromECDSAPub(key))
-// if _, ok := self.keys[k]; ok {
-// delete(self.keys, k)
-// return true
-// }
-// return false
-// }
-
// handlePeer is called by the underlying P2P layer when the whisper sub-protocol
// connection is negotiated.
func (self *Whisper) handlePeer(peer *p2p.Peer, rw p2p.MsgReadWriter) error {