config.go 2.5 KB

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