Merge pull request #16231 from gluk256/303-reader

whisper: filereader mode introduced to wnode
This commit is contained in:
gluk256
2018-03-03 09:40:01 +01:00
committed by GitHub
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