lnd+lnwallet: extract default wallet password vars into lnwallet

This commit is contained in:
Wilmer Paulino 2018-04-08 17:34:00 -04:00
parent b32e0ced45
commit 1a47d182d3
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F
2 changed files with 20 additions and 10 deletions

4
lnd.go

@ -196,8 +196,8 @@ func lndMain() error {
proxyOpts := []grpc.DialOption{grpc.WithTransportCredentials(cCreds)}
var (
privateWalletPw = []byte("hello")
publicWalletPw = []byte("public")
privateWalletPw = lnwallet.DefaultPrivatePassphrase
publicWalletPw = lnwallet.DefaultPublicPassphrase
birthday time.Time
recoveryWindow uint32
)

@ -11,10 +11,6 @@ import (
"github.com/roasbeef/btcutil"
)
// ErrNotMine is an error denoting that a WalletController instance is unable
// to spend a specified output.
var ErrNotMine = errors.New("the passed output doesn't belong to the wallet")
// AddressType is an enum-like type which denotes the possible address types
// WalletController supports.
type AddressType uint8
@ -32,10 +28,24 @@ const (
UnknownAddressType
)
// ErrDoubleSpend is returned from PublishTransaction in case the
// tx being published is spending an output spent by a conflicting
// transaction.
var ErrDoubleSpend = errors.New("Transaction rejected: output already spent")
var (
// DefaultPublicPassphrase is the default public passphrase used for the
// wallet.
DefaultPublicPassphrase = []byte("public")
// DefaultPrivatePassphrase is the default private passphrase used for
// the wallet.
DefaultPrivatePassphrase = []byte("hello")
// ErrDoubleSpend is returned from PublishTransaction in case the
// tx being published is spending an output spent by a conflicting
// transaction.
ErrDoubleSpend = errors.New("Transaction rejected: output already spent")
// ErrNotMine is an error denoting that a WalletController instance is
// unable to spend a specified output.
ErrNotMine = errors.New("the passed output doesn't belong to the wallet")
)
// Utxo is an unspent output denoted by its outpoint, and output value of the
// original output.