lntest: Improve HarnessNode stop logic and remove restart().

This commit is contained in:
Jim Posen authored and Olaoluwa Osuntokun committed 2017-12-14 20:06:23 -08:00
1 parent 19ed1fb8db
commit 02177a3f1c
2 files changed
+32 -44

No files matched your search

+11 -1
View File
@@ -338,7 +338,17 @@ func (n *NetworkHarness) DisconnectNodes(ctx context.Context, a, b *HarnessNode)
// and invalidated prior state, or persistent state recovery, simulating node
// crashes, etc.
func (n *NetworkHarness) RestartNode(node *HarnessNode, callback func() error) error {
return node.restart(n.lndErrorChan, callback)
if err := node.stop(); err != nil {
return err
}
if callback != nil {
if err := callback(); err != nil {
return err
}
}
return node.start(n.lndErrorChan)
}
// ShutdownNode stops an active lnd process and returns when the process has