Skip to content

Commit

Permalink
minor: rename sendLoop/receiveLoop
Browse files Browse the repository at this point in the history
  • Loading branch information
pm47 committed Sep 11, 2023
1 parent 5443191 commit fd0204a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ class Peer(
}
}

suspend fun listen() {
suspend fun receiveLoop() {
try {
while (isActive) {
val received = session.receive { size -> socket.receiveFully(size) }
Expand All @@ -370,7 +370,7 @@ class Peer(
}
}

suspend fun respond() {
suspend fun sendLoop() {
try {
for (msg in peerConnection.output) {
// Avoids polluting the logs with pings/pongs
Expand All @@ -386,9 +386,9 @@ class Peer(

launch { doPing() }
launch { checkPaymentsTimeout() }
launch { respond() }
launch { sendLoop() }

listen() // This suspends until the coroutines is cancelled or the socket is closed
receiveLoop() // This suspends until the coroutines is cancelled or the socket is closed
}

private suspend fun watchSwapInWallet() {
Expand Down

0 comments on commit fd0204a

Please sign in to comment.