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

lightningnetwork / lnd / 13180337775

06 Feb 2025 01:54PM UTC coverage: 57.708% (+8.4%) from 49.279%
13180337775

Pull #9470

github

ziggie1984
walletrpc+lncli: add new param. to bumpfee rpc.

Add new parameter deadline-delta to the bumpfee request and only
allow it to be used when the budget value is used as well.
Pull Request #9470: Make sure we fail the bump fee request as long as no budget is specified

103606 of 179536 relevant lines covered (57.71%)

24866.63 hits per line

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

84.21
/graph/errors.go
1
package graph
2

3
import "github.com/go-errors/errors"
4

5
// ErrorCode is used to represent the various errors that can occur within this
6
// package.
7
type ErrorCode uint8
8

9
const (
10
        // ErrOutdated is returned when the routing update already have
11
        // been applied, or a newer update is already known.
12
        ErrOutdated ErrorCode = iota
13

14
        // ErrIgnored is returned when the update have been ignored because
15
        // this update can't bring us something new, or because a node
16
        // announcement was given for node not found in any channel.
17
        ErrIgnored
18

19
        // ErrChannelSpent is returned when we go to validate a channel, but
20
        // the purported funding output has actually already been spent on
21
        // chain.
22
        ErrChannelSpent
23

24
        // ErrNoFundingTransaction is returned when we are unable to find the
25
        // funding transaction described by the short channel ID on chain.
26
        ErrNoFundingTransaction
27

28
        // ErrInvalidFundingOutput is returned if the channel funding output
29
        // fails validation.
30
        ErrInvalidFundingOutput
31
)
32

33
// Error is a structure that represent the error inside the graph package,
34
// this structure carries additional information about error code in order to
35
// be able distinguish errors outside of the current package.
36
type Error struct {
37
        err  *errors.Error
38
        code ErrorCode
39
}
40

41
// Error represents errors as the string
42
// NOTE: Part of the error interface.
43
func (e *Error) Error() string {
×
44
        return e.err.Error()
×
45
}
×
46

47
// A compile time check to ensure Error implements the error interface.
48
var _ error = (*Error)(nil)
49

50
// NewErrf creates a Error by the given error formatted description and
51
// its corresponding error code.
52
func NewErrf(code ErrorCode, format string, a ...interface{}) *Error {
207✔
53
        return &Error{
207✔
54
                code: code,
207✔
55
                err:  errors.Errorf(format, a...),
207✔
56
        }
207✔
57
}
207✔
58

59
// IsError is a helper function which is needed to have ability to check that
60
// returned error has specific error code.
61
func IsError(e interface{}, codes ...ErrorCode) bool {
617✔
62
        err, ok := e.(*Error)
617✔
63
        if !ok {
620✔
64
                return false
3✔
65
        }
3✔
66

67
        for _, code := range codes {
1,432✔
68
                if err.code == code {
1,227✔
69
                        return true
409✔
70
                }
409✔
71
        }
72

73
        return false
205✔
74
}
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