From fd0204a40e5fdfb0100ba8130030062e545c5053 Mon Sep 17 00:00:00 2001 From: pm47 Date: Mon, 11 Sep 2023 14:20:49 +0200 Subject: [PATCH] minor: rename sendLoop/receiveLoop --- src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt b/src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt index cc919596a..0719934d3 100644 --- a/src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt +++ b/src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt @@ -352,7 +352,7 @@ class Peer( } } - suspend fun listen() { + suspend fun receiveLoop() { try { while (isActive) { val received = session.receive { size -> socket.receiveFully(size) } @@ -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 @@ -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() {