浏览代码

Locator fix

Adam Ierymenko 6 年之前
父节点
当前提交
9b8d191bb1
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      go/pkg/zerotier/locator.go

+ 2 - 4
go/pkg/zerotier/locator.go

@@ -147,6 +147,7 @@ func NewLocatorFromBytes(b []byte) (*Locator, error) {
 			loc.Virtual = append(loc.Virtual, id)
 			loc.Virtual = append(loc.Virtual, id)
 		}
 		}
 	}
 	}
+	loc.Bytes = b
 
 
 	return &loc, nil
 	return &loc, nil
 }
 }
@@ -185,9 +186,6 @@ func (l *Locator) UnmarshalJSON(j []byte) error {
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}
-	l.Identity = tmp.Identity
-	l.Physical = tmp.Physical
-	l.Virtual = tmp.Virtual
-	l.Bytes = bytes.Bytes
+	*l = *tmp
 	return nil
 	return nil
 }
 }