mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
p2p/simulations: LiveEvents DidConnect and DidDisconnect use GetOrCreateConn
This commit is contained in:
parent
c86d0f4d25
commit
a4b52df32c
1 changed files with 4 additions and 4 deletions
|
|
@ -700,8 +700,8 @@ func (self *Network) Disconnect(oneId, otherId *adapters.NodeId) error {
|
|||
}
|
||||
|
||||
func (self *Network) DidConnect(one, other *adapters.NodeId) error {
|
||||
conn := self.GetConn(one, other)
|
||||
if conn == nil {
|
||||
conn, err := self.GetOrCreateConn(one, other)
|
||||
if err != nil {
|
||||
return fmt.Errorf("connection between %v and %v does not exist", one, other)
|
||||
}
|
||||
if conn.Up {
|
||||
|
|
@ -715,8 +715,8 @@ func (self *Network) DidConnect(one, other *adapters.NodeId) error {
|
|||
}
|
||||
|
||||
func (self *Network) DidDisconnect(one, other *adapters.NodeId) error {
|
||||
conn := self.GetConn(one, other)
|
||||
if conn == nil {
|
||||
conn, err := self.GetOrCreateConn(one, other)
|
||||
if err != nil {
|
||||
return fmt.Errorf("connection between %v and %v does not exist", one, other)
|
||||
}
|
||||
if !conn.Up {
|
||||
|
|
|
|||
Loading…
Reference in a new issue