diff --git a/eclair-core/src/main/scala/fr/acinq/eclair/router/RouteCalculation.scala b/eclair-core/src/main/scala/fr/acinq/eclair/router/RouteCalculation.scala index d1c409dd9..88537387b 100644 --- a/eclair-core/src/main/scala/fr/acinq/eclair/router/RouteCalculation.scala +++ b/eclair-core/src/main/scala/fr/acinq/eclair/router/RouteCalculation.scala @@ -118,6 +118,7 @@ object RouteCalculation { log.info(s"finding routes ${r.source}->${r.target} with assistedChannels={} ignoreNodes={} ignoreChannels={} excludedChannels={}", assistedChannels.keys.mkString(","), r.ignore.nodes.map(_.value).mkString(","), r.ignore.channels.mkString(","), d.excludedChannels.mkString(",")) log.info("finding routes with params={}, multiPart={}", params, r.allowMultiPart) + log.info("local channels to recipient: {}", d.graph.getEdgesBetween(r.source, r.target).map(e => s"${e.desc.shortChannelId} (${e.balance_opt}/${e.capacity})").mkString(", ")) val tags = TagSet.Empty.withTag(Tags.MultiPart, r.allowMultiPart).withTag(Tags.Amount, Tags.amountBucket(r.amount)) KamonExt.time(Metrics.FindRouteDuration.withTags(tags.withTag(Tags.NumberOfRoutes, routesToFind.toLong))) { val result = if (r.allowMultiPart) { diff --git a/eclair-core/src/main/scala/fr/acinq/eclair/router/Validation.scala b/eclair-core/src/main/scala/fr/acinq/eclair/router/Validation.scala index 36fb78114..66b007c17 100644 --- a/eclair-core/src/main/scala/fr/acinq/eclair/router/Validation.scala +++ b/eclair-core/src/main/scala/fr/acinq/eclair/router/Validation.scala @@ -300,8 +300,10 @@ object Validation { // update the graph val pc1 = pc.applyChannelUpdate(update) val graph1 = if (u.channelFlags.isEnabled) { + update.left.foreach(_ => log.info("added local shortChannelId={} public={} to the network graph", u.shortChannelId, publicChannel)) d.graph.addEdge(desc, u, pc1.capacity, pc1.getBalanceSameSideAs(u)) } else { + update.left.foreach(_ => log.info("removed local shortChannelId={} public={} from the network graph", u.shortChannelId, publicChannel)) d.graph.removeEdge(desc) } d.copy(channels = d.channels + (u.shortChannelId -> pc1), rebroadcast = d.rebroadcast.copy(updates = d.rebroadcast.updates + (u -> origins)), graph = graph1) @@ -313,6 +315,7 @@ object Validation { // we also need to update the graph val pc1 = pc.applyChannelUpdate(update) val graph1 = d.graph.addEdge(desc, u, pc1.capacity, pc1.getBalanceSameSideAs(u)) + update.left.foreach(_ => log.info("added local shortChannelId={} public={} to the network graph", u.shortChannelId, publicChannel)) d.copy(channels = d.channels + (u.shortChannelId -> pc1), privateChannels = d.privateChannels - u.shortChannelId, rebroadcast = d.rebroadcast.copy(updates = d.rebroadcast.updates + (u -> origins)), graph = graph1) } } else if (d.awaiting.keys.exists(c => c.shortChannelId == u.shortChannelId)) { @@ -349,8 +352,10 @@ object Validation { // we also need to update the graph val pc1 = pc.applyChannelUpdate(update) val graph1 = if (u.channelFlags.isEnabled) { + update.left.foreach(_ => log.info("added local shortChannelId={} public={} to the network graph", u.shortChannelId, publicChannel)) d.graph.addEdge(desc, u, pc1.capacity, pc1.getBalanceSameSideAs(u)) } else { + update.left.foreach(_ => log.info("removed local shortChannelId={} public={} from the network graph", u.shortChannelId, publicChannel)) d.graph.removeEdge(desc) } d.copy(privateChannels = d.privateChannels + (u.shortChannelId -> pc1), graph = graph1) @@ -361,6 +366,7 @@ object Validation { // we also need to update the graph val pc1 = pc.applyChannelUpdate(update) val graph1 = d.graph.addEdge(desc, u, pc1.capacity, pc1.getBalanceSameSideAs(u)) + update.left.foreach(_ => log.info("added local shortChannelId={} public={} to the network graph", u.shortChannelId, publicChannel)) d.copy(privateChannels = d.privateChannels + (u.shortChannelId -> pc1), graph = graph1) } } else if (db.isPruned(u.shortChannelId) && !StaleChannels.isStale(u)) { @@ -441,7 +447,7 @@ object Validation { d } else if (d.privateChannels.contains(shortChannelId)) { // the channel was private or public-but-not-yet-announced, let's do the clean up - log.debug("removing private local channel and channel_update for channelId={} shortChannelId={}", channelId, shortChannelId) + log.info("removing private local channel and channel_update for channelId={} shortChannelId={}", channelId, shortChannelId) val desc1 = ChannelDesc(shortChannelId, localNodeId, remoteNodeId) val desc2 = ChannelDesc(shortChannelId, remoteNodeId, localNodeId) // we remove the corresponding updates from the graph