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