forked from lightningnetwork/lnd
-
Notifications
You must be signed in to change notification settings - Fork 24
/
config.go
62 lines (51 loc) · 1.96 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
60
61
62
package remotedcrwallet
import (
"github.com/decred/dcrd/chaincfg/v3"
"github.com/decred/dcrlnd/blockcache"
"github.com/decred/dcrlnd/channeldb"
"github.com/decred/dcrlnd/lnwallet"
"github.com/decred/dcrlnd/lnwallet/chainfee"
"google.golang.org/grpc"
)
// WalletSyncer is an exported interface for the available wallet sync backends
// (RPC, SPV, etc). While this interface is exported to ease construction of a
// Config structure, only implementations provided by this package are
// supported, since currently the implementation is tightly coupled to the
// DcrWallet struct.
//
// The current backend implementations also implement the BlockChainIO
// interface.
type WalletSyncer interface {
lnwallet.BlockChainIO
start(w *DcrWallet) error
stop()
}
// Config is a struct which houses configuration parameters which modify the
// instance of DcrWallet generated by the New() function.
type Config struct {
// PrivatePass is the private password to the underlying dcrwallet
// instance. Without this, the wallet cannot be decrypted and operated.
PrivatePass []byte
// FeeEstimator is an instance of the fee estimator interface which
// will be used by the wallet to dynamically set transaction fees when
// crafting transactions.
FeeEstimator chainfee.Estimator
// NetParams is the net parameters for the target chain.
NetParams *chaincfg.Params
// Conn is a grpc connection to an already opened wallet. This needs to
// be filled for the wallet to work.
Conn *grpc.ClientConn
// AccountNumber is the account number to use to perform the ln
// operations.
AccountNumber int32
// ChainIO is a direct connection to the blockchain IO driver needed by
// the wallet.
//
// TODO(decred) Ideally this should be performed by wallet operations
// but not all operations needed by the drivers are currently
// implemented in the wallet.
ChainIO lnwallet.BlockChainIO
// BlockCache is an optional in-memory block cacher.
BlockCache *blockcache.BlockCache
DB *channeldb.DB
}