Skip to content

Add an async resolution option to ChainAccess::get_utxo#1980

Merged
wpaulino merged 16 commits intolightningdevkit:mainfrom
TheBlueMatt:2023-01-async-utxo-lookups
Feb 11, 2023
Merged

Add an async resolution option to ChainAccess::get_utxo#1980
wpaulino merged 16 commits intolightningdevkit:mainfrom
TheBlueMatt:2023-01-async-utxo-lookups

Conversation

@TheBlueMatt
Copy link
Collaborator

For those operating in an async environment, requiring
ChainAccess::get_utxo return information about the requested UTXO
synchronously is incredibly painful. Requesting information about a
random UTXO is likely to go over the network, and likely to be a
rather slow request.

Thus, here, we change the return type of get_utxo to have both a
synchronous and asynchronous form. The asynchronous form requires
the user construct a AccessFuture which they clone and pass
back to us. Internally, an AccessFuture has an Arc to the
channel_announcement message which we need to process. When the
user completes their lookup, they call resolve on their
AccessFuture which we pull the channel_announcement from and
then apply to the network graph.

Fixes #1975.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make chain::Access async-optional

4 participants