graph/db: only init extra byte if not nil
In preparation for having consistency with the structs created by the SQLStore and the KVStore (so that they have the same behaviour when tested by the unit tests), here we make sure not to init the ExtraOpaqueData field of the LightningNode struct unless there are actualy bytes to set.
This commit is contained in:
3 files changed
+8
-6
No files matched your search
@@ -494,10 +494,9 @@ func buildNode(ctx context.Context, db SQLQueries, dbNode *sqlc.Node) (
|
||||
copy(pub[:], dbNode.PubKey)
|
||||
|
||||
node := &models.LightningNode{
|
||||
PubKeyBytes: pub,
|
||||
Features: lnwire.EmptyFeatureVector(),
|
||||
LastUpdate: time.Unix(0, 0),
|
||||
ExtraOpaqueData: make([]byte, 0),
|
||||
PubKeyBytes: pub,
|
||||
Features: lnwire.EmptyFeatureVector(),
|
||||
LastUpdate: time.Unix(0, 0),
|
||||
}
|
||||
|
||||
if len(dbNode.Signature) == 0 {
|
||||
|
||||
Reference in new issue
Block a user