• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightningnetwork / lnd / 17215686384

25 Aug 2025 05:13PM UTC coverage: 56.933% (-0.4%) from 57.321%
17215686384

Pull #9147

github

web-flow
Merge 84ace3fea into 0c2f045f5
Pull Request #9147: [Part 1|3] Introduce SQL Payment schema into LND

58 of 1339 new or added lines in 9 files covered. (4.33%)

42 existing lines in 11 files now uncovered.

99232 of 174295 relevant lines covered (56.93%)

1.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/payments/db/options.go
1
package paymentsdb
2

3
// StoreOptions holds parameters for the KVStore.
4
type StoreOptions struct {
5
        // NoMigration allows to open the database in readonly mode
6
        NoMigration bool
7

8
        // KeepFailedPaymentAttempts is a flag that determines whether to keep
9
        // failed payment attempts for a settled payment in the db.
10
        KeepFailedPaymentAttempts bool
11
}
12

13
// DefaultOptions returns a StoreOptions populated with default values.
14
func DefaultOptions() *StoreOptions {
3✔
15
        return &StoreOptions{
3✔
16
                KeepFailedPaymentAttempts: false,
3✔
17
                NoMigration:               false,
3✔
18
        }
3✔
19
}
3✔
20

21
// StoreOptionModifier is a function signature for modifying the default
22
// StoreOptions.
23
type StoreOptionModifier func(*StoreOptions)
24

25
// WithKeepFailedPaymentAttempts sets the KeepFailedPaymentAttempts to n.
26
func WithKeepFailedPaymentAttempts(n bool) StoreOptionModifier {
3✔
27
        return func(o *StoreOptions) {
6✔
28
                o.KeepFailedPaymentAttempts = n
3✔
29
        }
3✔
30
}
31

32
// WithNoMigration allows the database to be opened in read only mode by
33
// disabling migrations.
NEW
34
func WithNoMigration(b bool) StoreOptionModifier {
×
35
        return func(o *StoreOptions) {
×
36
                o.NoMigration = b
×
37
        }
×
38
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc