Skip to content

Conversation

@rustaceanrob
Copy link
Collaborator

The lookup_host function requires a tokio runtime to execute, but since it is outside of the Node, this function panics when called. Add a runtime, which is essentially an OS thread in this context, to complete the call.

Notes to the reviewers

In the future I could potentially find a more elegant way to do this, but this call should be relatively short and only consume a single thread.

Changelog notice

  • Fix lookup_host on CbfClient

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@rustaceanrob
Copy link
Collaborator Author

Tested locally with:

let peers = await client.lookupHost(hostname: "seed.bitcoin.sprovoost.nl")

In the LiveKyotoTests.swift and was able to successfully get a DNS response

Copy link
Collaborator

@reez reez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 6f2e566

The `lookup_host` function requires a `tokio` runtime to execute, but
since it is outside of the `Node`, this function panics when called. Add
a runtime, which is essentially an OS thread in this context, to
complete the call.
@thunderbiscuit thunderbiscuit merged commit 9ddddef into bitcoindevkit:master Jul 30, 2025
24 checks passed
@rustaceanrob rustaceanrob deleted the dns-7-28 branch July 30, 2025 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants