lntest: add SuspendNode
This commit is contained in:
parent
53d319ad10
commit
52941cec53
@ -556,6 +556,20 @@ func (n *NetworkHarness) RestartNode(node *HarnessNode, callback func() error) e
|
||||
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
|
||||
// exited and any temporary directories have been cleaned up.
|
||||
func (n *NetworkHarness) ShutdownNode(node *HarnessNode) error {
|
||||
|
Loading…
Reference in New Issue
Block a user