github.com/decred/dcrlnd@v0.7.6/lnwallet/config.go (about)

     1  package lnwallet
     2  
     3  import (
     4  	"github.com/decred/dcrd/chaincfg/v3"
     5  	"github.com/decred/dcrlnd/chainntnfs"
     6  	"github.com/decred/dcrlnd/channeldb"
     7  	"github.com/decred/dcrlnd/input"
     8  	"github.com/decred/dcrlnd/keychain"
     9  	"github.com/decred/dcrlnd/lnwallet/chainfee"
    10  )
    11  
    12  // Config is a struct which houses configuration parameters which modify the
    13  // behaviour of LightningWallet.
    14  //
    15  // NOTE: The passed channeldb, and ChainNotifier should already be fully
    16  // initialized/started before being passed as a function argument.
    17  type Config struct {
    18  	// Database is a wrapper around a namespace within bboltdb reserved for
    19  	// ln-based wallet metadata. See the 'channeldb' package for further
    20  	// information.
    21  	Database *channeldb.ChannelStateDB
    22  
    23  	// Notifier is used by in order to obtain notifications about funding
    24  	// transaction reaching a specified confirmation depth, and to catch
    25  	// counterparty's broadcasting revoked commitment states.
    26  	Notifier chainntnfs.ChainNotifier
    27  
    28  	// SecretKeyRing is used by the wallet during the funding workflow
    29  	// process to obtain keys to be used directly within contracts. Usage
    30  	// of this interface ensures that all key derivation is itself fully
    31  	// deterministic.
    32  	SecretKeyRing keychain.SecretKeyRing
    33  
    34  	// WalletController is the core wallet, all non Lightning Network
    35  	// specific interaction is proxied to the internal wallet.
    36  	WalletController WalletController
    37  
    38  	// input.Signer is the wallet's current input.Signer implementation. This input.Signer is
    39  	// used to generate signature for all inputs to potential funding
    40  	// transactions, as well as for spends from the funding transaction to
    41  	// update the commitment state.
    42  	Signer input.Signer
    43  
    44  	// FeeEstimator is the implementation that the wallet will use for the
    45  	// calculation of on-chain transaction fees.
    46  	FeeEstimator chainfee.Estimator
    47  
    48  	// ChainIO is an instance of the BlockChainIO interface. ChainIO is
    49  	// used to lookup the existence of outputs within the UTXO set.
    50  	ChainIO BlockChainIO
    51  
    52  	// DefaultConstraints is the set of default constraints that will be
    53  	// used for any incoming or outgoing channel reservation requests.
    54  	DefaultConstraints channeldb.ChannelConstraints
    55  
    56  	// NetParams is the set of parameters that tells the wallet which chain
    57  	// it will be operating on.
    58  	NetParams chaincfg.Params
    59  }