1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-02-24 14:50:46 +01:00

Fix ClassCastException when mapping the channels responses to ByteVector instead of ByteVector32

This commit is contained in:
Andrea 2019-03-15 13:56:07 +01:00
parent 53ec015e02
commit 8c3d7d843a
No known key found for this signature in database
GPG key ID: FFB3470FFF04CA76
2 changed files with 4 additions and 4 deletions

View file

@ -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
}

View file

@ -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")
}