@@ -24,7 +24,7 @@ import (
2424const (
2525 // DBFilename is the filename within the data directory which contains
2626 // the macaroon stores.
27- DBFilename = "accounts.db "
27+ DBFilename = "accounts.DB "
2828
2929 // dbPathPermission is the default permission the account database
3030 // directory is created with (if it does not exist).
6060
6161// BoltStore wraps the bolt DB that stores all accounts and their balances.
6262type BoltStore struct {
63- db kvdb.Backend
63+ DB kvdb.Backend
6464 clock clock.Clock
6565}
6666
@@ -101,7 +101,7 @@ func NewBoltStore(dir, fileName string, clock clock.Clock) (*BoltStore, error) {
101101
102102 // Return the DB wrapped in a BoltStore object.
103103 return & BoltStore {
104- db : db ,
104+ DB : db ,
105105 clock : clock ,
106106 }, nil
107107}
@@ -110,7 +110,7 @@ func NewBoltStore(dir, fileName string, clock clock.Clock) (*BoltStore, error) {
110110//
111111// NOTE: This is part of the Store interface.
112112func (s * BoltStore ) Close () error {
113- return s .db .Close ()
113+ return s .DB .Close ()
114114}
115115
116116// NewAccount creates a new OffChainBalanceAccount with the given balance and a
@@ -162,7 +162,7 @@ func (s *BoltStore) NewAccount(ctx context.Context, balance lnwire.MilliSatoshi,
162162
163163 // Try storing the account in the account database, so we can keep track
164164 // of its balance.
165- err := s .db .Update (func (tx walletdb.ReadWriteTx ) error {
165+ err := s .DB .Update (func (tx walletdb.ReadWriteTx ) error {
166166 bucket := tx .ReadWriteBucket (accountBucketName )
167167 if bucket == nil {
168168 return ErrAccountBucketNotFound
@@ -364,7 +364,7 @@ func (s *BoltStore) DeleteAccountPayment(_ context.Context, id AccountID,
364364func (s * BoltStore ) updateAccount (id AccountID ,
365365 updateFn func (* OffChainBalanceAccount ) error ) error {
366366
367- return s .db .Update (func (tx kvdb.RwTx ) error {
367+ return s .DB .Update (func (tx kvdb.RwTx ) error {
368368 bucket := tx .ReadWriteBucket (accountBucketName )
369369 if bucket == nil {
370370 return ErrAccountBucketNotFound
@@ -451,7 +451,7 @@ func (s *BoltStore) Account(_ context.Context, id AccountID) (
451451 // Try looking up and reading the account by its ID from the local
452452 // bolt DB.
453453 var accountBinary []byte
454- err := s .db .View (func (tx kvdb.RTx ) error {
454+ err := s .DB .View (func (tx kvdb.RTx ) error {
455455 bucket := tx .ReadBucket (accountBucketName )
456456 if bucket == nil {
457457 return ErrAccountBucketNotFound
@@ -487,7 +487,7 @@ func (s *BoltStore) Accounts(_ context.Context) ([]*OffChainBalanceAccount,
487487 error ) {
488488
489489 var accounts []* OffChainBalanceAccount
490- err := s .db .View (func (tx kvdb.RTx ) error {
490+ err := s .DB .View (func (tx kvdb.RTx ) error {
491491 // This function will be called in the ForEach and receive
492492 // the key and value of each account in the DB. The key, which
493493 // is also the ID is not used because it is also marshaled into
@@ -531,7 +531,7 @@ func (s *BoltStore) Accounts(_ context.Context) ([]*OffChainBalanceAccount,
531531//
532532// NOTE: This is part of the Store interface.
533533func (s * BoltStore ) RemoveAccount (_ context.Context , id AccountID ) error {
534- return s .db .Update (func (tx kvdb.RwTx ) error {
534+ return s .DB .Update (func (tx kvdb.RwTx ) error {
535535 bucket := tx .ReadWriteBucket (accountBucketName )
536536 if bucket == nil {
537537 return ErrAccountBucketNotFound
@@ -554,7 +554,7 @@ func (s *BoltStore) LastIndexes(_ context.Context) (uint64, uint64, error) {
554554 var (
555555 addValue , settleValue []byte
556556 )
557- err := s .db .View (func (tx kvdb.RTx ) error {
557+ err := s .DB .View (func (tx kvdb.RTx ) error {
558558 bucket := tx .ReadBucket (accountBucketName )
559559 if bucket == nil {
560560 return ErrAccountBucketNotFound
@@ -592,7 +592,7 @@ func (s *BoltStore) StoreLastIndexes(_ context.Context, addIndex,
592592 byteOrder .PutUint64 (addValue , addIndex )
593593 byteOrder .PutUint64 (settleValue , settleIndex )
594594
595- return s .db .Update (func (tx kvdb.RwTx ) error {
595+ return s .DB .Update (func (tx kvdb.RwTx ) error {
596596 bucket := tx .ReadWriteBucket (accountBucketName )
597597 if bucket == nil {
598598 return ErrAccountBucketNotFound
0 commit comments