Fixed jail.cells nil assignment (#398)

jail.cells is now re-created upon Jail.Stop, not assigned to nil. Assigning it to nil led to runtime panic when a node was stopped and started again.
This commit is contained in:
Ivan Tomilov 2017-10-13 15:13:20 +03:00 committed by GitHub
parent 12412b3f58
commit 16741f9517
1 changed files with 2 additions and 1 deletions

View File

@ -75,7 +75,8 @@ func (jail *Jail) Stop() {
for _, cell := range jail.cells {
cell.Stop()
}
jail.cells = nil
// TODO(tiabc): Move this initialisation to a proper place.
jail.cells = make(map[string]*Cell)
}
// Cell returns the existing instance of Cell.