mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
fixed whisper bug for unencrypted messages
This commit is contained in:
parent
ab664c7e17
commit
bad3f49d24
1 changed files with 6 additions and 3 deletions
|
|
@ -23,7 +23,6 @@ import (
|
|||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/crypto/ecies"
|
||||
"github.com/ethereum/go-ethereum/event/filter"
|
||||
"github.com/ethereum/go-ethereum/logger"
|
||||
"github.com/ethereum/go-ethereum/logger/glog"
|
||||
|
|
@ -305,8 +304,12 @@ func (self *Whisper) open(envelope *Envelope) *Message {
|
|||
if err == nil {
|
||||
message.To = &key.PublicKey
|
||||
return message
|
||||
} else if err == ecies.ErrInvalidPublicKey {
|
||||
return message
|
||||
} else {
|
||||
origMessage, err := envelope.Open(nil)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return origMessage
|
||||
}
|
||||
}
|
||||
// Failed to decrypt, don't return anything
|
||||
|
|
|
|||
Loading…
Reference in a new issue