Skip to content

Commit

Permalink
channeldb: add encoding for ChannelEdgeInfo2
Browse files Browse the repository at this point in the history
In this commit, we update the `putChanEdgeInfo` function to take in the
models.ChannelEdgeInfo interface. If the passed value is the legacy
models.ChannelEdgeInfo1, then the encoding and decoding remains the same
but if it is the new models.ChannelEdgeInfo2 then:
- the encoding will be prefixed with a 0xff byte. This should not clash
  with the encoding of the legacy struct since that encoding will always
  start with a pub key (of node 1) which means it will always start with
  0x02 or 0x03.
- The 0xff is then followed by a type-byte which will be used to
  identify the encoding that follows (this is to make it future proof).
  For now, there is only one possible type-byte here.
- This is then followed by the TLV encoding of ChannelEdgeInfo2.
  • Loading branch information
ellemouton committed Aug 23, 2024
1 parent b454481 commit 8162c52
Show file tree
Hide file tree
Showing 3 changed files with 657 additions and 79 deletions.
Loading

0 comments on commit 8162c52

Please sign in to comment.