whisper: filereader mode introduced to wnode

This commit is contained in:
Vlad
2018-03-02 14:54:54 +01:00
parent a76e46e3d7
commit 6219a33822
2 changed files with 41 additions and 0 deletions

View File

@@ -208,6 +208,10 @@ func (e *Envelope) OpenSymmetric(key []byte) (msg *ReceivedMessage, err error) {
// Open tries to decrypt an envelope, and populates the message fields in case of success.
func (e *Envelope) Open(watcher *Filter) (msg *ReceivedMessage) {
if watcher == nil {
return nil
}
// The API interface forbids filters doing both symmetric and asymmetric encryption.
if watcher.expectsAsymmetricEncryption() && watcher.expectsSymmetricEncryption() {
return nil