MaxOnlineTime *uint `json:"maxonlinetime,omitempty"`
WhenTxExists *bool `json:"when-tx-exists,omitempty"`
NoCK *bool `json:"nock"`
+ MCDIgnore *bool `json:"mcd-ignore"`
AutoToss *bool `json:"autotoss,omitempty"`
AutoTossDoSeen *bool `json:"autotoss-doseen,omitempty"`
Self *NodeOurJSON `json:"self"`
Neigh map[string]NodeJSON `json:"neigh"`
+
+ MCDRxIfis []string `json:"mcd-listen"`
+ MCDTxIfis map[string]int `json:"mcd-send"`
}
func NewNode(name string, cfg NodeJSON) (*Node, error) {
if callCfg.NoCK != nil {
call.NoCK = *callCfg.NoCK
}
+ if callCfg.MCDIgnore != nil {
+ call.MCDIgnore = *callCfg.MCDIgnore
+ }
if callCfg.AutoToss != nil {
call.AutoToss = *callCfg.AutoToss
}
func CfgParse(data []byte) (*Ctx, error) {
var err error
- if bytes.Compare(data[:8], MagicNNCPBv3[:]) == 0 {
+ if bytes.Compare(data[:8], MagicNNCPBv3.B[:]) == 0 {
os.Stderr.WriteString("Passphrase:") // #nosec G104
password, err := term.ReadPassword(0)
if err != nil {
if err != nil {
return nil, err
}
+ } else if bytes.Compare(data[:8], MagicNNCPBv2.B[:]) == 0 {
+ log.Fatalln(MagicNNCPBv2.TooOld())
+ } else if bytes.Compare(data[:8], MagicNNCPBv1.B[:]) == 0 {
+ log.Fatalln(MagicNNCPBv1.TooOld())
}
var cfgGeneral map[string]interface{}
if err = hjson.Unmarshal(data, &cfgGeneral); err != nil {
Self: self,
Neigh: make(map[NodeId]*Node, len(cfgJSON.Neigh)),
Alias: make(map[string]*NodeId),
+ MCDRxIfis: cfgJSON.MCDRxIfis,
+ MCDTxIfis: cfgJSON.MCDTxIfis,
}
if cfgJSON.Notify != nil {
if cfgJSON.Notify.File != nil {