htlcswitch: extend ChannelLink interface with ShutdownIfChannelClean
This allows a caller to ensure to optimistically shut down the link if the channel is clean. If the channel is not clean, an error is returned and the link continues functioning as normal. The caller should also call RemoveLink to ensure that the link isn't seen as usable within the switch.
This commit is contained in:
5 files changed
+149
-6
No files matched your search
@@ -5,6 +5,9 @@ import "github.com/go-errors/errors"
|
||||
var (
|
||||
// ErrLinkShuttingDown signals that the link is shutting down.
|
||||
ErrLinkShuttingDown = errors.New("link shutting down")
|
||||
|
||||
// ErrLinkFailedShutdown signals that a requested shutdown failed.
|
||||
ErrLinkFailedShutdown = errors.New("link failed to shutdown")
|
||||
)
|
||||
|
||||
// errorCode encodes the possible types of errors that will make us fail the
|
||||
|
||||
Reference in new issue
Block a user