p2p/simulations: return already connected error from Load function

This commit is contained in:
Janos Guljas 2018-12-05 10:04:15 +01:00
parent dd75dde1a7
commit 3f5f1375b2

View file

@ -22,7 +22,6 @@ import (
"encoding/json"
"errors"
"fmt"
"strings"
"sync"
"time"
@ -792,7 +791,7 @@ func (net *Network) Load(snap *Snapshot) error {
//so it would result in the snapshot `Load` to fail
continue
}
if err := net.Connect(conn.One, conn.Other); err != nil && !strings.Contains(err.Error(), "already connected") {
if err := net.Connect(conn.One, conn.Other); err != nil {
return err
}
}