@@ -98,12 +98,16 @@ func NewBoltStore(dir, fileName string) (*BoltStore, error) {
98
98
}
99
99
100
100
// Close closes the underlying bolt DB.
101
+ //
102
+ // NOTE: This is part of the Store interface.
101
103
func (s * BoltStore ) Close () error {
102
104
return s .db .Close ()
103
105
}
104
106
105
107
// NewAccount creates a new OffChainBalanceAccount with the given balance and a
106
108
// randomly chosen ID.
109
+ //
110
+ // NOTE: This is part of the Store interface.
107
111
func (s * BoltStore ) NewAccount (ctx context.Context , balance lnwire.MilliSatoshi ,
108
112
expirationDate time.Time , label string ) (* OffChainBalanceAccount ,
109
113
error ) {
@@ -175,6 +179,8 @@ func (s *BoltStore) NewAccount(ctx context.Context, balance lnwire.MilliSatoshi,
175
179
176
180
// UpdateAccount writes an account to the database, overwriting the existing one
177
181
// if it exists.
182
+ //
183
+ // NOTE: This is part of the Store interface.
178
184
func (s * BoltStore ) UpdateAccount (_ context.Context ,
179
185
account * OffChainBalanceAccount ) error {
180
186
@@ -228,6 +234,8 @@ func uniqueRandomAccountID(accountBucket kvdb.RBucket) (AccountID, error) {
228
234
229
235
// Account retrieves an account from the bolt DB and un-marshals it. If the
230
236
// account cannot be found, then ErrAccNotFound is returned.
237
+ //
238
+ // NOTE: This is part of the Store interface.
231
239
func (s * BoltStore ) Account (_ context.Context , id AccountID ) (
232
240
* OffChainBalanceAccount , error ) {
233
241
@@ -264,6 +272,8 @@ func (s *BoltStore) Account(_ context.Context, id AccountID) (
264
272
}
265
273
266
274
// Accounts retrieves all accounts from the bolt DB and un-marshals them.
275
+ //
276
+ // NOTE: This is part of the Store interface.
267
277
func (s * BoltStore ) Accounts (_ context.Context ) ([]* OffChainBalanceAccount ,
268
278
error ) {
269
279
@@ -309,6 +319,8 @@ func (s *BoltStore) Accounts(_ context.Context) ([]*OffChainBalanceAccount,
309
319
}
310
320
311
321
// RemoveAccount finds an account by its ID and removes it from the DB.
322
+ //
323
+ // NOTE: This is part of the Store interface.
312
324
func (s * BoltStore ) RemoveAccount (_ context.Context , id AccountID ) error {
313
325
return s .db .Update (func (tx kvdb.RwTx ) error {
314
326
bucket := tx .ReadWriteBucket (accountBucketName )
@@ -327,6 +339,8 @@ func (s *BoltStore) RemoveAccount(_ context.Context, id AccountID) error {
327
339
328
340
// LastIndexes returns the last invoice add and settle index or
329
341
// ErrNoInvoiceIndexKnown if no indexes are known yet.
342
+ //
343
+ // NOTE: This is part of the Store interface.
330
344
func (s * BoltStore ) LastIndexes (_ context.Context ) (uint64 , uint64 , error ) {
331
345
var (
332
346
addValue , settleValue []byte
@@ -359,6 +373,8 @@ func (s *BoltStore) LastIndexes(_ context.Context) (uint64, uint64, error) {
359
373
}
360
374
361
375
// StoreLastIndexes stores the last invoice add and settle index.
376
+ //
377
+ // NOTE: This is part of the Store interface.
362
378
func (s * BoltStore ) StoreLastIndexes (_ context.Context , addIndex ,
363
379
settleIndex uint64 ) error {
364
380
0 commit comments