diff --git a/src/commonMain/kotlin/fr/acinq/lightning/blockchain/electrum/ElectrumMiniWallet.kt b/src/commonMain/kotlin/fr/acinq/lightning/blockchain/electrum/ElectrumMiniWallet.kt index 6e51645b2..d88ee085a 100644 --- a/src/commonMain/kotlin/fr/acinq/lightning/blockchain/electrum/ElectrumMiniWallet.kt +++ b/src/commonMain/kotlin/fr/acinq/lightning/blockchain/electrum/ElectrumMiniWallet.kt @@ -170,8 +170,8 @@ class ElectrumMiniWallet( val addressMeta = bitcoinAddress?.let { addressMetas[it] } return when { bitcoinAddress == null || addressMeta == null -> { - // this should never happen - logger.error { "received subscription response for script hash ${msg.scriptHash} that does not match any address" } + // this will happen because multiple wallets may be sharing the same Electrum connection (e.g. swap-in and final wallet) + logger.debug { "received subscription response for script hash ${msg.scriptHash} that does not match any address" } this } msg.status == null -> { @@ -200,7 +200,7 @@ class ElectrumMiniWallet( */ suspend fun WalletState.subscribe(scriptHash: ByteVector32, bitcoinAddress: String): WalletState { val response = client.startScriptHashSubscription(scriptHash) - logger.info { "subscribed to address=$bitcoinAddress scriptHash=$scriptHash" } + logger.debug { "subscribed to address=$bitcoinAddress scriptHash=$scriptHash" } return processSubscriptionResponse(response) } @@ -213,7 +213,7 @@ class ElectrumMiniWallet( suspend fun WalletState.addAddress(bitcoinAddress: String, meta: WalletState.Companion.AddressMeta): WalletState { return computeScriptHash(bitcoinAddress)?.let { scriptHash -> if (!scriptHashes.containsKey(scriptHash)) { - logger.info { "adding new address=${bitcoinAddress} index=${meta.indexOrNull ?: "n/a"}" } + logger.debug { "adding new address=${bitcoinAddress} index=${meta.indexOrNull ?: "n/a"}" } scriptHashes = scriptHashes + (scriptHash to bitcoinAddress) addressMetas = addressMetas + (bitcoinAddress to meta) subscribe(scriptHash, bitcoinAddress)