mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-25 20:47:42 +02:00
tlv+hop: contain odd/even logic in payload parsing
Tlv is used more widely in lnd than just for the onion payload. This commit isolated the protocol-specific odd/even logic, so that tlv can be used freely elsewhere. An example of this use is db serialization.
This commit is contained in:
@@ -12,8 +12,9 @@ import (
|
||||
// Type is an 64-bit identifier for a TLV Record.
|
||||
type Type uint64
|
||||
|
||||
// TypeSet is an unordered set of Types.
|
||||
type TypeSet map[Type]struct{}
|
||||
// TypeSet is an unordered set of Types. The map item boolean values indicate
|
||||
// whether the type that we parsed was known.
|
||||
type TypeSet map[Type]bool
|
||||
|
||||
// Encoder is a signature for methods that can encode TLV values. An error
|
||||
// should be returned if the Encoder cannot support the underlying type of val.
|
||||
|
Reference in New Issue
Block a user