Skip to content

Commit

Permalink
Merge pull request #128 from hyperledger-labs/remove-unused-code
Browse files Browse the repository at this point in the history
Remove unused `ordered` parameter
  • Loading branch information
siburu authored Dec 4, 2023
2 parents eb9a250 + 90fb6c2 commit ae204cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
3 changes: 1 addition & 2 deletions cmd/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ func createChannelCmd(ctx *config.Context) *cobra.Command {
if _, err = c[dst].GetAddress(); err != nil {
return err
}

return core.CreateChannel(c[src], c[dst], false, to)
return core.CreateChannel(c[src], c[dst], to)
},
}

Expand Down
12 changes: 3 additions & 9 deletions core/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,14 @@ import (

// CreateChannel runs the channel creation messages on timeout until they pass
// TODO: add max retries or something to this function
func CreateChannel(src, dst *ProvableChain, ordered bool, to time.Duration) error {
func CreateChannel(src, dst *ProvableChain, to time.Duration) error {
logger := GetChannelPairLogger(src, dst)
defer logger.TimeTrack(time.Now(), "CreateChannel")
var order chantypes.Order
if ordered {
order = chantypes.ORDERED
} else {
order = chantypes.UNORDERED
}

ticker := time.NewTicker(to)
failures := 0
for ; true; <-ticker.C {
chanSteps, err := createChannelStep(src, dst, order)
chanSteps, err := createChannelStep(src, dst)
if err != nil {
logger.Error(
"failed to create channel step",
Expand Down Expand Up @@ -75,7 +69,7 @@ func CreateChannel(src, dst *ProvableChain, ordered bool, to time.Duration) erro
return nil
}

func createChannelStep(src, dst *ProvableChain, ordering chantypes.Order) (*RelayMsgs, error) {
func createChannelStep(src, dst *ProvableChain) (*RelayMsgs, error) {
out := NewRelayMsgs()
if err := validatePaths(src, dst); err != nil {
return nil, err
Expand Down

0 comments on commit ae204cd

Please sign in to comment.