whisper: refactoring

This commit is contained in:
Vlad
2018-02-23 14:52:25 +01:00
parent b677a07d36
commit 6919c36432
3 changed files with 3 additions and 51 deletions

View File

@@ -590,10 +590,7 @@ func (whisper *Whisper) Unsubscribe(id string) error {
// network in the coming cycles.
func (whisper *Whisper) Send(envelope *Envelope) error {
ok, err := whisper.add(envelope, false)
if err != nil {
return err
}
if !ok {
if err == nil && !ok {
return fmt.Errorf("failed to add envelope")
}
return err