From 8c3d7d843a887fd3d79cc15ea13bb18b74ba2e45 Mon Sep 17 00:00:00 2001 From: Andrea Date: Fri, 15 Mar 2019 13:56:07 +0100 Subject: [PATCH] Fix ClassCastException when mapping the channels responses to ByteVector instead of ByteVector32 --- .../src/main/scala/fr/acinq/eclair/api/EclairApi.scala | 6 +++--- .../src/main/scala/fr/acinq/eclair/api/NewService.scala | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eclair-core/src/main/scala/fr/acinq/eclair/api/EclairApi.scala b/eclair-core/src/main/scala/fr/acinq/eclair/api/EclairApi.scala index b444ff7aa..82766c844 100644 --- a/eclair-core/src/main/scala/fr/acinq/eclair/api/EclairApi.scala +++ b/eclair-core/src/main/scala/fr/acinq/eclair/api/EclairApi.scala @@ -99,12 +99,12 @@ class EclairApiImpl(appKit: Kit, getInfo: Future[GetInfoResponse]) extends Eclai override def channelsInfo(toRemoteNode: Option[PublicKey]): Future[Iterable[RES_GETINFO]] = toRemoteNode match { case Some(pk) => for { - channelsId <- (appKit.register ? 'channelsTo).mapTo[Map[ByteVector, PublicKey]].map(_.filter(_._2 == pk).keys) + channelsId <- (appKit.register ? 'channelsTo).mapTo[Map[ByteVector32, PublicKey]].map(_.filter(_._2 == pk).keys) channels <- Future.sequence(channelsId.map(channelId => sendToChannel(channelId.toString(), CMD_GETINFO).mapTo[RES_GETINFO])) } yield channels case None => for { - channels_id <- (appKit.register ? 'channels).mapTo[Map[ByteVector, ActorRef]].map(_.keys) - channels <- Future.sequence(channels_id.map(channel_id => sendToChannel(channel_id.toString(), CMD_GETINFO).mapTo[RES_GETINFO])) + channels_id <- (appKit.register ? 'channels).mapTo[Map[ByteVector32, ActorRef]].map(_.keys) + channels <- Future.sequence(channels_id.map(channel_id => sendToChannel(channel_id.toHex, CMD_GETINFO).mapTo[RES_GETINFO])) } yield channels } diff --git a/eclair-core/src/main/scala/fr/acinq/eclair/api/NewService.scala b/eclair-core/src/main/scala/fr/acinq/eclair/api/NewService.scala index b8a4733eb..928d092cd 100644 --- a/eclair-core/src/main/scala/fr/acinq/eclair/api/NewService.scala +++ b/eclair-core/src/main/scala/fr/acinq/eclair/api/NewService.scala @@ -42,7 +42,7 @@ trait NewService extends Directives with Logging with MetaService { val apiExceptionHandler = ExceptionHandler { case t: Throwable => - logger.error(s"API call failed with cause=${t.getMessage}") + logger.error(s"API call failed with cause=${t.getMessage}", t) complete(StatusCodes.InternalServerError, s"Error: $t") }