From 527d12c89a182faecc1aadfc7a0befd893001beb Mon Sep 17 00:00:00 2001 From: Fabio Barone Date: Mon, 29 May 2017 12:06:56 -0500 Subject: [PATCH] p2p/simulations: return edge distance in stream update --- p2p/simulations/network.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/p2p/simulations/network.go b/p2p/simulations/network.go index 5ab18fed7f..5be6f45de3 100644 --- a/p2p/simulations/network.go +++ b/p2p/simulations/network.go @@ -37,8 +37,8 @@ import ( "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" - "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/pot" + "github.com/ethereum/go-ethereum/rpc" ) type NetworkConfig struct { @@ -167,9 +167,9 @@ type Conn struct { Up bool `json:"up"` // reverse is false by default (One dialled/dropped the Other) Reverse bool `json:"reverse"` - // A scalar distance value denoting how "far" Other is from One (Kademlia table) - Distance int `json:"distance"` - // indicates if a ControlEvent has already been fired for this connection + // A scalar distance value denoting how "far" Other is from One (Kademlia table) + Distance int `json:"distance"` + // indicates if a ControlEvent has already been fired for this connection controlFired bool } @@ -244,13 +244,13 @@ func (self *Network) newConn(oneID, otherID discover.NodeID) (*Conn, error) { if other == nil { return nil, fmt.Errorf("other %v does not exist", other) } - distance, _ := pot.NewBytesVal(one.Addr(), nil).PO(pot.NewBytesVal(other.Addr(), nil), 0) + distance, _ := pot.NewBytesVal(one.Addr(), nil).PO(pot.NewBytesVal(other.Addr(), nil), 0) return &Conn{ - One: oneID, - Other: otherID, - one: one, - other: other, - Distance: distance, + One: oneID, + Other: otherID, + one: one, + other: other, + Distance: distance, }, nil }