Initial support to remove Whisper identities per #491

This commit is contained in:
Taylor Gerring
2015-03-16 14:46:46 -04:00
parent e5e265d024
commit 03ac0f18ae
3 changed files with 26 additions and 2 deletions

View File

@@ -116,6 +116,15 @@ func (self *Whisper) GetIdentity(key *ecdsa.PublicKey) *ecdsa.PrivateKey {
return self.keys[string(crypto.FromECDSAPub(key))]
}
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
}
func (self *Whisper) Watch(opts Filter) int {
return self.filters.Install(filter.Generic{
Str1: string(crypto.FromECDSAPub(opts.To)),