@@ -21,6 +21,7 @@ const (
2121 typeExpirationDate tlv.Type = 6
2222 typeInvoices tlv.Type = 7
2323 typePayments tlv.Type = 8
24+ typeLabel tlv.Type = 9
2425)
2526
2627func serializeAccount (account * OffChainBalanceAccount ) ([]byte , error ) {
@@ -34,6 +35,7 @@ func serializeAccount(account *OffChainBalanceAccount) ([]byte, error) {
3435 initialBalance = uint64 (account .InitialBalance )
3536 currentBalance = uint64 (account .CurrentBalance )
3637 lastUpdate = uint64 (account .LastUpdate .UnixNano ())
38+ label = []byte (account .Label )
3739 )
3840
3941 tlvRecords := []tlv.Record {
@@ -55,6 +57,7 @@ func serializeAccount(account *OffChainBalanceAccount) ([]byte, error) {
5557 tlvRecords ,
5658 newHashMapRecord (typeInvoices , & account .Invoices ),
5759 newPaymentEntryMapRecord (typePayments , & account .Payments ),
60+ tlv .MakePrimitiveRecord (typeLabel , & label ),
5861 )
5962
6063 tlvStream , err := tlv .NewStream (tlvRecords ... )
@@ -80,6 +83,7 @@ func deserializeAccount(content []byte) (*OffChainBalanceAccount, error) {
8083 expirationDate uint64
8184 invoices map [lntypes.Hash ]struct {}
8285 payments map [lntypes.Hash ]* PaymentEntry
86+ label []byte
8387 )
8488
8589 tlvStream , err := tlv .NewStream (
@@ -91,6 +95,7 @@ func deserializeAccount(content []byte) (*OffChainBalanceAccount, error) {
9195 tlv .MakePrimitiveRecord (typeExpirationDate , & expirationDate ),
9296 newHashMapRecord (typeInvoices , & invoices ),
9397 newPaymentEntryMapRecord (typePayments , & payments ),
98+ tlv .MakePrimitiveRecord (typeLabel , & label ),
9499 )
95100 if err != nil {
96101 return nil , err
@@ -108,6 +113,7 @@ func deserializeAccount(content []byte) (*OffChainBalanceAccount, error) {
108113 LastUpdate : time .Unix (0 , int64 (lastUpdate )),
109114 Invoices : invoices ,
110115 Payments : payments ,
116+ Label : string (label ),
111117 }
112118 copy (account .ID [:], id )
113119
0 commit comments