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/common"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"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/event/filter"
|
||||||
"github.com/ethereum/go-ethereum/logger"
|
"github.com/ethereum/go-ethereum/logger"
|
||||||
"github.com/ethereum/go-ethereum/logger/glog"
|
"github.com/ethereum/go-ethereum/logger/glog"
|
||||||
|
|
@ -305,8 +304,12 @@ func (self *Whisper) open(envelope *Envelope) *Message {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
message.To = &key.PublicKey
|
message.To = &key.PublicKey
|
||||||
return message
|
return message
|
||||||
} else if err == ecies.ErrInvalidPublicKey {
|
} else {
|
||||||
return message
|
origMessage, err := envelope.Open(nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return origMessage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Failed to decrypt, don't return anything
|
// Failed to decrypt, don't return anything
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue