lntest: add SuspendNode

This commit is contained in:
Johan T. Halseth committed 2018-08-17 23:24:13 +02:00
1 parent 53d319ad10
commit 52941cec53
1 file changed
+14
+14
View File
@@ -556,6 +556,20 @@ func (n *NetworkHarness) RestartNode(node *HarnessNode, callback func() error) e
return node.start(n.lndErrorChan) return node.start(n.lndErrorChan)
} }
// SuspendNode stops the given node and returns a callback that can be used to
// start it again.
func (n *NetworkHarness) SuspendNode(node *HarnessNode) (func() error, error) {
if err := node.stop(); err != nil {
return nil, err
}
restart := func() error {
return node.start(n.lndErrorChan)
}
return restart, nil
}
// ShutdownNode stops an active lnd process and returns when the process has // ShutdownNode stops an active lnd process and returns when the process has
// exited and any temporary directories have been cleaned up. // exited and any temporary directories have been cleaned up.
func (n *NetworkHarness) ShutdownNode(node *HarnessNode) error { func (n *NetworkHarness) ShutdownNode(node *HarnessNode) error {