Fix for channel configuration
@@ -281,7 +281,6 @@ func (n *Node) StartChain(nid int) error {
}
if c.refresh {
if c, err = n._refresh(c); err != nil {
- log.Println(err)
return err
}
}
@@ -342,6 +341,7 @@ func (n *Node) ConfigureChain(nid int, key string, value string) error {
}
hit := false
+ refreshNow := false
if c.State() == chain.StateStarted.String() {
switch key {
case "seedAddress":
@@ -359,7 +359,6 @@ func (n *Node) ConfigureChain(nid int, key string, value string) error {
return errors.ErrInvalidState
}
hit = true
-
}
if c.State() == chain.StateStopped.String() {
switch key {
@@ -392,6 +391,7 @@ func (n *Node) ConfigureChain(nid int, key string, value string) error {
return errors.Wrapf(ErrAlreadyExists, "Network(channel=%s) already exists", value)
}
c.cfg.Channel = value
+ refreshNow = true
case "secureSuites":
if err := n.nt.SetSecureSuites(c.cfg.Channel, value); err != nil {
return err
@@ -417,7 +417,13 @@ func (n *Node) ConfigureChain(nid int, key string, value string) error {
}
if hit {
+ if refreshNow {
+ if c, err = n._refresh(c); err != nil {
+ return err
+ }
+ } else {
c.refresh = true
+ }
if err = n.saveChainConfig(c.cfg, c.cfg.FilePath); err != nil {
return err
}
