mirror of
https://github.com/ACINQ/eclair.git
synced 2025-03-06 10:32:08 +01:00
parent
00aef5c438
commit
012d804474
1 changed files with 4 additions and 1 deletions
|
@ -40,7 +40,10 @@ object LightningMessageCodecs {
|
||||||
.typecase(2, ipv6address) ~ uint16)
|
.typecase(2, ipv6address) ~ uint16)
|
||||||
.xmap(x => new InetSocketAddress(x._1, x._2), x => (x.getAddress, x.getPort))
|
.xmap(x => new InetSocketAddress(x._1, x._2), x => (x.getAddress, x.getPort))
|
||||||
|
|
||||||
def listofsocketaddresses: Codec[List[InetSocketAddress]] = listOfN(uint16, socketaddress)
|
// this one is a bit different from most other codecs: the first 'len' element is * not * the number of items
|
||||||
|
// in the list but rather the number of bytes of the encoded list. The rationale is once we've read this
|
||||||
|
// number of bytes we can just skip to the next field
|
||||||
|
def listofsocketaddresses: Codec[List[InetSocketAddress]] = variableSizeBytes(uint16, list(socketaddress))
|
||||||
|
|
||||||
def signature: Codec[BinaryData] = Codec[BinaryData](
|
def signature: Codec[BinaryData] = Codec[BinaryData](
|
||||||
(der: BinaryData) => bytes(64).encode(ByteVector(der2wire(der).toArray)),
|
(der: BinaryData) => bytes(64).encode(ByteVector(der2wire(der).toArray)),
|
||||||
|
|
Loading…
Add table
Reference in a new issue