Skip to content

Commit

Permalink
Update Hop struct
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Sep 10, 2019
1 parent ec20b3a commit 48280c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions pkg/route-finder/client/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ func (r *mockClient) PairedRoutes(src, dst cipher.PubKey, minHops, maxHops uint1
return []routing.Route{
{
&routing.Hop{
From: src,
To: dst,
Transport: transport.MakeTransportID(src, dst, ""),
TpID: transport.MakeTransportID(src, dst, ""),
From: src,
To: dst,
},
},
}, []routing.Route{
{
&routing.Hop{
From: src,
To: dst,
Transport: transport.MakeTransportID(src, dst, ""),
TpID: transport.MakeTransportID(src, dst, ""),
From: src,
To: dst,
},
},
}, nil
Expand Down
8 changes: 4 additions & 4 deletions pkg/routing/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import (

// Hop defines a route hop between 2 nodes.
type Hop struct {
From cipher.PubKey
To cipher.PubKey
Transport uuid.UUID
TpID uuid.UUID
From cipher.PubKey
To cipher.PubKey
}

func (h Hop) String() string {
return fmt.Sprintf("%s -> %s @ %s", h.From, h.To, h.Transport)
return fmt.Sprintf("%s -> %s @ %s", h.From, h.To, h.TpID)
}

// Route is a succession of transport entries that denotes a path from source node to destination node
Expand Down
2 changes: 1 addition & 1 deletion pkg/setup/idreservoir.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func SaveForwardRules(rules RulesMap, idc *idReservoir, keepAlive time.Duration,
if !ok {
return 0, 0, errors.New("fucked up")
}
rule := routing.IntermediaryForwardRule(keepAlive, rID, nxtRID, hop.Transport)
rule := routing.IntermediaryForwardRule(keepAlive, rID, nxtRID, hop.TpID)
rules[hop.From] = append(rules[hop.From], rule)

rID = nxtRID
Expand Down

0 comments on commit 48280c4

Please sign in to comment.