Versions in this module Expand all Collapse all v1 v1.0.0 May 10, 2019 Changes in this version + const DefaultReadTimeout + const DefaultStatInterval + const DefaultWriteTimeout + var ErrClientExiting = errors.New("watchtower client shutting down") + var ErrFailedNegotiation = errors.New("session negotiation unsuccessful") + var ErrNegotiatorExiting = errors.New("negotiator exiting") + var ErrNoTowerAddrs = errors.New("no tower addresses") + var ErrPermanentTowerFailure = errors.New("permanent tower failure") + var ErrTowerCandidatesExhausted = errors.New(...) + var ErrUnregisteredChannel = errors.New("channel is not registered") + func AuthDial(localPriv *btcec.PrivateKey, netAddr *lnwire.NetAddress, ...) (wtserver.Peer, error) + func DeriveSessionKey(keyRing SecretKeyRing, index uint32) (*btcec.PrivateKey, error) + func DisableLog() + func UseLogger(logger btclog.Logger) + type AuthDialer func(localPriv *btcec.PrivateKey, netAddr *lnwire.NetAddress, ...) (wtserver.Peer, error) + type Client interface + BackupState func(*lnwire.ChannelID, *lnwallet.BreachRetribution) error + ForceQuit func() + RegisterChannel func(lnwire.ChannelID) error + Start func() error + Stop func() error + type Config struct + AuthDial AuthDialer + ChainHash chainhash.Hash + DB DB + Dial Dial + ForceQuitDelay time.Duration + MaxBackoff time.Duration + MinBackoff time.Duration + NewAddress func() ([]byte, error) + Policy wtpolicy.Policy + PrivateTower *lnwire.NetAddress + ReadTimeout time.Duration + SecretKeyRing SecretKeyRing + Signer input.Signer + WriteTimeout time.Duration + type DB interface + AckUpdate func(id *wtdb.SessionID, seqNum, lastApplied uint16) error + AddChanPkScript func(lnwire.ChannelID, []byte) error + CommitUpdate func(id *wtdb.SessionID, seqNum uint16, update *wtdb.CommittedUpdate) (uint16, error) + CreateClientSession func(*wtdb.ClientSession) error + CreateTower func(*lnwire.NetAddress) (*wtdb.Tower, error) + FetchChanPkScripts func() (map[lnwire.ChannelID][]byte, error) + ListClientSessions func() (map[wtdb.SessionID]*wtdb.ClientSession, error) + LoadTower func(uint64) (*wtdb.Tower, error) + MarkBackupIneligible func(chanID lnwire.ChannelID, commitHeight uint64) error + NextSessionKeyIndex func(uint64) (uint32, error) + type Dial func(net, addr string) (net.Conn, error) + type NegotiatorConfig struct + Candidates TowerCandidateIterator + ChainHash chainhash.Hash + DB DB + Dial func(*btcec.PrivateKey, *lnwire.NetAddress) (wtserver.Peer, error) + MaxBackoff time.Duration + MinBackoff time.Duration + Policy wtpolicy.Policy + ReadMessage func(wtserver.Peer) (wtwire.Message, error) + SecretKeyRing SecretKeyRing + SendMessage func(wtserver.Peer, wtwire.Message) error + type SecretKeyRing interface + DerivePrivKey func(loc keychain.KeyDescriptor) (*btcec.PrivateKey, error) + type SessionNegotiator interface + NewSessions func() <-chan *wtdb.ClientSession + RequestSession func() + Start func() error + Stop func() error + type TowerCandidateIterator interface + Next func() (*wtdb.Tower, error) + Reset func() error + type TowerClient struct + func New(config *Config) (*TowerClient, error) + func (c *TowerClient) BackupState(chanID *lnwire.ChannelID, breachInfo *lnwallet.BreachRetribution) error + func (c *TowerClient) ForceQuit() + func (c *TowerClient) RegisterChannel(chanID lnwire.ChannelID) error + func (c *TowerClient) Start() error + func (c *TowerClient) Stop() error