Skip to content

Commit

Permalink
Merge pull request #101 from xssnick/dht-panic-fix
Browse files Browse the repository at this point in the history
DHT Closed adnl panic fix
  • Loading branch information
xssnick authored Jan 31, 2023
2 parents ea11768 + 6b1efd0 commit 46dbf5f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<img align="right" width="425px" src="https://github.com/xssnick/props/blob/master/logoimg.png?raw=true">

[![Based on TON][ton-svg]][ton]
![Coverage](https://img.shields.io/badge/Coverage-72.0%25-brightgreen)
![Coverage](https://img.shields.io/badge/Coverage-72.2%25-brightgreen)

Golang library for interacting with TON blockchain.

Expand Down
2 changes: 1 addition & 1 deletion adnl/dht/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ func (c *Client) FindValue(ctx context.Context, key *Key) (*Value, error) {
threadCtx, stopThreads := context.WithCancel(ctx)
defer stopThreads()

const threads = 4
const threads = 16
result := make(chan *Value, threads)
var numNoTasks int64
for i := 0; i < threads; i++ {
Expand Down
4 changes: 3 additions & 1 deletion adnl/dht/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ func (n *dhtNode) changeState(state int) {

if state == _StateFail {
// in case of fail - close connection
n.adnl.Close()
if n.adnl != nil {
n.adnl.Close()
}
n.adnl = nil

// try to reconnect only if it was active before
Expand Down

0 comments on commit 46dbf5f

Please sign in to comment.