-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework and simplify electrum client, miniwallet and watcher (#411)
* Rework and simplify electrum client, miniwallet and watcher CompletableDeferred<> is used to handle multiple concurrent calls and provide suspend methods which are much easier to use. For example, to retrieve a transaction you can simply call `client.getTx(txid)` and you can chain such calls in your message handling loops: this eliminate the need to send messages to yourself and create intermediate states that are just waiting for a response from the electrum client. We also fix a bug where Phoenix would crash after being disconnected because it would try to use a closed socket to send Ping messages. * Add a handler for exceptions thrown in electrum's main coroutine * Add a specific ElectrumSubscriptionResponse type for subscription events Apply suggestions from https://github.com/ACINQ/lightning-kmp/compare/electrum-client-rework-pm and add a new ElectrumSubscriptionResponse type for subscription events.
- Loading branch information
Showing
10 changed files
with
460 additions
and
1,105 deletions.
There are no files selected for viewing
377 changes: 112 additions & 265 deletions
377
src/commonMain/kotlin/fr/acinq/lightning/blockchain/electrum/ElectrumClient.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.