diff --git a/htlcswitch/interfaces.go b/htlcswitch/interfaces.go index 68350f62..4dff21a5 100644 --- a/htlcswitch/interfaces.go +++ b/htlcswitch/interfaces.go @@ -6,6 +6,7 @@ import ( "github.com/lightningnetwork/lnd/invoices" "github.com/lightningnetwork/lnd/lnpeer" "github.com/lightningnetwork/lnd/lntypes" + "github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwire" ) @@ -159,3 +160,20 @@ type ForwardingLog interface { // visualizations, etc. AddForwardingEvents([]channeldb.ForwardingEvent) error } + +// TowerClient is the primary interface used by the daemon to backup pre-signed +// justice transactions to watchtowers. +type TowerClient interface { + // RegisterChannel persistently initializes any channel-dependent + // parameters within the client. This should be called during link + // startup to ensure that the client is able to support the link during + // operation. + RegisterChannel(lnwire.ChannelID) error + + // BackupState initiates a request to back up a particular revoked + // state. If the method returns nil, the backup is guaranteed to be + // successful unless the tower is unavailable and client is force quit, + // or the justice transaction would create dust outputs when trying to + // abide by the negotiated policy. + BackupState(*lnwire.ChannelID, *lnwallet.BreachRetribution) error +}