Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DHT Closed adnl panic fix #101

Merged
merged 3 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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