Skip to content

Commit

Permalink
Fixup: reword channel interceptor error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sstone committed Jul 16, 2024
1 parent fccdf95 commit 401e3a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ private class OpenChannelInterceptor(peer: ActorRef[Any],
private def sanityCheckNonInitiator(request: OpenChannelNonInitiator): Behavior[Command] = {
validateRemoteChannelType(request.temporaryChannelId, request.channelFlags, request.channelType_opt, request.localFeatures, request.remoteFeatures) match {
case Right(_: ChannelTypes.Standard) =>
context.log.warn("rejecting new obsolete incoming channels")
context.log.warn("rejecting incoming channel: anchor outputs must be used for new channels")
sendFailure("rejecting incoming channel: anchor outputs must be used for new channels", request)
waitForRequest()
case Right(_: ChannelTypes.StaticRemoteKey) if !nodeParams.channelConf.acceptIncomingStaticRemoteKeyChannels =>
context.log.warn("rejecting new static_remote_key incoming channels")
sendFailure("rejecting new static_remote_key incoming channels", request)
context.log.warn("rejecting static_remote_key incoming static_remote_key channels")
sendFailure("rejecting incoming static_remote_key channel: anchor outputs must be used for new channels", request)
waitForRequest()
case Right(channelType) =>
val dualFunded = Features.canUseFeature(request.localFeatures, request.remoteFeatures, Features.DualFunding)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class OpenChannelInterceptorSpec extends ScalaTestWithActorTestKit(ConfigFactory

val openChannelNonInitiator = OpenChannelNonInitiator(remoteNodeId, Left(openChannel), staticRemoteKeyFeatures, staticRemoteKeyFeatures, peerConnection.ref, remoteAddress)
openChannelInterceptor ! openChannelNonInitiator
assert(peer.expectMessageType[OutgoingMessage].msg.asInstanceOf[Error].toAscii.contains("rejecting new static_remote_key incoming channels"))
assert(peer.expectMessageType[OutgoingMessage].msg.asInstanceOf[Error].toAscii.contains("rejecting incoming static_remote_key channel: anchor outputs must be used for new channels"))
eventListener.expectMessageType[ChannelAborted]
}

Expand Down

0 comments on commit 401e3a8

Please sign in to comment.