channeldb: complete migration 12 for TLV invoices

This commit is contained in:
Conner Fromknecht
2019-11-22 02:24:28 -08:00
parent 76682ad820
commit 4c872c438b
10 changed files with 216 additions and 144 deletions

View File

@@ -154,8 +154,6 @@ type Invoice struct {
// LegacyDeserializeInvoice decodes an invoice from the passed io.Reader using
// the pre-TLV serialization.
//
// nolint: dupl
func LegacyDeserializeInvoice(r io.Reader) (Invoice, error) {
var err error
invoice := Invoice{}
@@ -241,6 +239,8 @@ func deserializeHtlcs(r io.Reader) ([]byte, error) {
}
// SerializeInvoice serializes an invoice to a writer.
//
// nolint: dupl
func SerializeInvoice(w io.Writer, i *Invoice) error {
creationDateBytes, err := i.CreationDate.MarshalBinary()
if err != nil {