Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
channeldb: add encoding for ChannelEdgeInfo2
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