Skip to content

Commit

Permalink
curio/lmrpc: Override unspecified rpc address to localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Apr 14, 2024
1 parent 5c59b74 commit 4f042eb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions curiosrc/market/lmrpc/lmrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ func MakeTokens(cfg *config.CurioConfig) (map[address.Address]string, error) {
return xerrors.Errorf("net resolve: %w", err)
}

if len(laddr.IP) == 0 {
// set localhost
laddr.IP = net.IPv4(127, 0, 0, 1)
if len(laddr.IP) == 0 || laddr.IP.IsUnspecified() {
return xerrors.Errorf("market rpc server listen address must be a specific address, not %s (probably missing bind IP)", listen)
}

// need minimal provider with just the config
Expand Down Expand Up @@ -171,9 +170,8 @@ func ServeCurioMarketRPC(db *harmonydb.DB, full api.FullNode, maddr address.Addr
return xerrors.Errorf("net resolve: %w", err)
}

if len(laddr.IP) == 0 {
// set localhost
laddr.IP = net.IPv4(127, 0, 0, 1)
if len(laddr.IP) == 0 || laddr.IP.IsUnspecified() {
return xerrors.Errorf("market rpc server listen address must be a specific address, not %s (probably missing bind IP)", listen)
}
rootUrl := url.URL{
Scheme: "http",
Expand Down

0 comments on commit 4f042eb

Please sign in to comment.