Fix error parsing address in AcceptOfferDialog (#3491)

This commit is contained in:
benthecarman 2021-08-05 17:44:05 -05:00 committed by GitHub
parent e315fb0563
commit 66813dc7c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,7 +13,6 @@ import scalafx.scene.control._
import scalafx.scene.layout._
import scalafx.stage.Window
import java.net.{InetSocketAddress, URI}
import scala.collection._
import scala.util.{Failure, Success, Try}
@ -23,14 +22,10 @@ class AcceptOfferDialog extends CliCommandProducer[AcceptDLCCliCommand] {
val offerHex = offerTLVTF.text.value
val offer = LnMessageFactory(DLCOfferTLV).fromHex(offerHex)
if (peerAddressTF.text.value.nonEmpty) {
val peer = new URI(
"tcp://" + NetworkUtil.parseInetSocketAddress(peerAddressTF.text.value,
2862))
val peer =
NetworkUtil.parseInetSocketAddress(peerAddressTF.text.value, 2862)
val peerAddr =
InetSocketAddress.createUnresolved(peer.getHost, peer.getPort)
AcceptDLC(offer, peerAddr)
AcceptDLC(offer, peer)
} else {
AcceptDLCOffer(offer)
}