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

fix newHeads unsubscribe #1895

Merged
merged 1 commit into from
May 7, 2024
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
3 changes: 0 additions & 3 deletions go/common/subscription/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,5 @@ func ForwardFromChannels[R any](inputChannels []chan R, unsubscribed *atomic.Boo
// Must be called as a go routine!
func HandleUnsubscribe(connectionSub *rpc.Subscription, unsubscribed *atomic.Bool, onUnsub func()) {
<-connectionSub.Err()
if unsubscribed != nil {
unsubscribed.Store(true)
}
onUnsub()
}
1 change: 1 addition & 0 deletions go/host/rpc/clientapi/client_api_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func (api *FilterAPI) Logs(ctx context.Context, encryptedParams common.Encrypted
})
go subscriptioncommon.HandleUnsubscribe(subscription, &unsubscribed, func() {
api.host.UnsubscribeLogs(subscription.ID)
unsubscribed.Store(true)
})
return subscription, nil
}
Expand Down
4 changes: 1 addition & 3 deletions go/node/docker_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import (
"github.com/ten-protocol/go-ten/go/common/docker"
)

var (
_enclaveDataDir = "/enclavedata" // this is how the directory is references within the enclave container
)
var _enclaveDataDir = "/enclavedata" // this is how the directory is references within the enclave container

type DockerNode struct {
cfg *Config
Expand Down
1 change: 1 addition & 0 deletions tools/walletextension/rpcapi/filter_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func (api *FilterAPI) Logs(ctx context.Context, crit common.FilterCriteria) (*rp
for _, connection := range backendWSConnections {
_ = returnConn(api.we.rpcWSConnPool, connection.BackingClient())
}
unsubscribed.Store(true)
})

return subscription, err
Expand Down
Loading