Skip to content

Commit

Permalink
Fixed no active connections panic in liteclient
Browse files Browse the repository at this point in the history
  • Loading branch information
xssnick committed Dec 4, 2023
1 parent a15378d commit d5ce60c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion adnl/rldp/http/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ func getDNSResolver() *dns.Client {
}

// initialize ton api lite connection wrapper
api := ton.NewAPIClient(client)
api := ton.NewAPIClient(client).WithRetry()

// get root dns address from network config
root, err := dns.RootContractAddr(api)
Expand Down
5 changes: 5 additions & 0 deletions liteclient/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ func (c *ConnectionPool) queryWithBalancer(req *ADNLRequest) (string, error) {
return "", ErrNoActiveConnections
}

if reqNode == nil {
// no active nodes in list
return "", ErrNoActiveConnections
}

host, err := reqNode.queryAdnl(req.QueryID, req.Data)
if err != nil {
if !errors.Is(err, NetworkErr{}) {
Expand Down

0 comments on commit d5ce60c

Please sign in to comment.