mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 05:43:51 +01:00
Allow both lnmessage and raw tlv to be sent over rpc for acceptdlc (#4140)
This commit is contained in:
parent
44b2ca3c3d
commit
b86d4e492c
@ -934,8 +934,14 @@ object AcceptDLC extends ServerJsonModels {
|
||||
offerJs: Value,
|
||||
addrJs: Value,
|
||||
payoutAddressJs: Value,
|
||||
changeAddressJs: Value) = Try {
|
||||
val offer = LnMessageFactory(DLCOfferTLV).fromHex(offerJs.str)
|
||||
changeAddressJs: Value): Try[AcceptDLC] = Try {
|
||||
val lnMessageOfferT = LnMessageFactory(DLCOfferTLV)
|
||||
.fromHexT(offerJs.str)
|
||||
val offer: LnMessage[DLCOfferTLV] = lnMessageOfferT match {
|
||||
case Success(o) => o
|
||||
case Failure(_) => LnMessage(DLCOfferTLV.fromHex(offerJs.str))
|
||||
}
|
||||
|
||||
val uri = new URI("tcp://" + addrJs.str)
|
||||
val peerAddr =
|
||||
InetSocketAddress.createUnresolved(uri.getHost, uri.getPort)
|
||||
|
Loading…
Reference in New Issue
Block a user