Skip to content

Commit

Permalink
Merge pull request #300 from skycoin/bug/fix-create-loop
Browse files Browse the repository at this point in the history
reverted json encoding
  • Loading branch information
ivcosla authored Apr 23, 2019
2 parents de0a3c6 + 0d9590e commit 18eed39
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
1 change: 0 additions & 1 deletion pkg/router/route_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ func (rm *routeManager) Serve(rw io.ReadWriter) error {
t, body, err := proto.ReadPacket()

if err != nil {
fmt.Println("err:", err)
return err
}
rm.Logger.Infof("Got new Setup request with type %s", t)
Expand Down
12 changes: 6 additions & 6 deletions pkg/routing/loop.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (

// Loop defines a loop over a pair of routes.
type Loop struct {
LocalPort uint16 `json:"local_port"`
RemotePort uint16 `json:"remote_port"`
Forward Route `json:"forward_route"`
Reverse Route `json:"reverse_route"`
Expiry time.Time `json:"expiry"`
NoiseMessage []byte `json:"-"`
LocalPort uint16
RemotePort uint16
Forward Route
Reverse Route
Expiry time.Time
NoiseMessage []byte
}

// Initiator returns initiator of the Loop.
Expand Down
6 changes: 3 additions & 3 deletions pkg/routing/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

// Hop defines a route hop between 2 nodes.
type Hop struct {
From cipher.PubKey `json:"src"`
To cipher.PubKey `json:"dst"`
Transport uuid.UUID `json:"tid"`
From cipher.PubKey
To cipher.PubKey
Transport uuid.UUID
}

func (h Hop) String() string {
Expand Down
10 changes: 5 additions & 5 deletions pkg/setup/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ const (

// LoopData stores loop confirmation request data.
type LoopData struct {
RemotePK cipher.PubKey `json:"remote_pk"`
RemotePort uint16 `json:"remote_port"`
LocalPort uint16 `json:"local_port"`
RouteID routing.RouteID `json:"resp_rid,omitempty"`
NoiseMessage []byte `json:"noise_msg,omitempty"`
RemotePK cipher.PubKey `json:"remote-pk"`
RemotePort uint16 `json:"remote-port"`
LocalPort uint16 `json:"local-port"`
RouteID routing.RouteID `json:"resp-rid,omitempty"`
NoiseMessage []byte `json:"noise-msg,omitempty"`
}

// Protocol defines routes setup protocol.
Expand Down

0 comments on commit 18eed39

Please sign in to comment.