Commit Graph

2 Commits

Author SHA1 Message Date
Joost Jager
e8fd05e8e3
tlv+record+routing: add payload size calculation 2019-12-20 11:00:01 +01:00
Conner Fromknecht
3afcb1f224
tlv/varint: add modified bitcoin varint
This varint has the same serialization as the varint in btcd and
bitcoind, but has different behavior wrt returned errors. In order to
ensure the inner loop properly detects cleanly written records,
ReadVarInt will not only return EOF if it can't read the first byte, as
that means the reader has zero bytes left.

It also modifies the API to allow the caller to provided a static byte
array, which can be reused across all encoding and decoding and
increases performance.
2019-08-07 15:03:05 -07:00