record: move CustomRecordSet

This commit is contained in:
Joost Jager
2019-12-12 00:01:55 +01:00
parent 7aa4a7c7fc
commit 8b5bb0ac63
9 changed files with 34 additions and 35 deletions

View File

@@ -13,7 +13,6 @@ import (
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcutil"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/htlcswitch/hop"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnwire"
@@ -385,9 +384,9 @@ func UnmarshallCustomRecords(rpcRecords map[uint64][]byte) ([]tlv.Record,
// tlvRecords is sorted, so we only need to check that the first
// element is within the custom range.
if uint64(tlvRecords[0].Type()) < hop.CustomTypeStart {
if uint64(tlvRecords[0].Type()) < record.CustomTypeStart {
return nil, fmt.Errorf("no custom records with types "+
"below %v allowed", hop.CustomTypeStart)
"below %v allowed", record.CustomTypeStart)
}
return tlvRecords, nil