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

lightningnetwork / lnd / 13566028875

27 Feb 2025 12:09PM UTC coverage: 49.396% (-9.4%) from 58.748%
13566028875

Pull #9555

github

ellemouton
graph/db: populate the graph cache in Start instead of during construction

In this commit, we move the graph cache population logic out of the
ChannelGraph constructor and into its Start method instead.
Pull Request #9555: graph: extract cache from CRUD [6]

34 of 54 new or added lines in 4 files covered. (62.96%)

27464 existing lines in 436 files now uncovered.

101095 of 204664 relevant lines covered (49.4%)

1.54 hits per line

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

26.67
/feature/required.go
1
package feature
2

3
import (
4
        "fmt"
5

6
        "github.com/lightningnetwork/lnd/lnwire"
7
)
8

9
// ErrUnknownRequired signals that a feature vector requires certain features
10
// that our node is unaware of or does not implement.
11
type ErrUnknownRequired struct {
12
        unknown []lnwire.FeatureBit
13
}
14

15
// NewErrUnknownRequired initializes an ErrUnknownRequired with the unknown
16
// feature bits.
UNCOV
17
func NewErrUnknownRequired(unknown []lnwire.FeatureBit) ErrUnknownRequired {
×
UNCOV
18
        return ErrUnknownRequired{
×
UNCOV
19
                unknown: unknown,
×
UNCOV
20
        }
×
UNCOV
21
}
×
22

23
// Error returns a human-readable description of the error.
UNCOV
24
func (e ErrUnknownRequired) Error() string {
×
UNCOV
25
        return fmt.Sprintf("feature vector contains unknown required "+
×
UNCOV
26
                "features: %v", e.unknown)
×
UNCOV
27
}
×
28

29
// ValidateRequired returns an error if the feature vector contains a non-zero
30
// number of unknown, required feature bits.
31
func ValidateRequired(fv *lnwire.FeatureVector) error {
3✔
32
        unknown := fv.UnknownRequiredFeatures()
3✔
33
        if len(unknown) > 0 {
3✔
UNCOV
34
                return NewErrUnknownRequired(unknown)
×
UNCOV
35
        }
×
36
        return nil
3✔
37
}
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