Skip to content

Commit

Permalink
Add logs when starting peer and swap-in watcher job (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpad85 authored Aug 28, 2023
1 parent 68a0e64 commit 72be0a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ class Peer(
private var swapInJob: Job? = null

init {
logger.info { "initializing peer" }
launch {
watcher.client.notifications.filterIsInstance<HeaderSubscriptionResponse>()
.collect { msg ->
Expand Down Expand Up @@ -391,6 +392,7 @@ class Peer(
* Warning: not thread-safe!
*/
suspend fun startWatchSwapInWallet() {
logger.info { "starting swap-in watch job" }
if (swapInJob != null) return
// wait to have a swap-in feerate available
swapInFeeratesFlow.filterNotNull().first()
Expand All @@ -410,6 +412,7 @@ class Peer(
}

suspend fun stopWatchSwapInWallet() {
logger.info { "stopping swap-in watch job" }
swapInJob?.cancelAndJoin()
swapInJob = null
}
Expand Down

0 comments on commit 72be0a3

Please sign in to comment.