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

lightningnetwork / lnd / 11364879019

16 Oct 2024 11:39AM UTC coverage: 49.778% (+0.5%) from 49.297%
11364879019

Pull #9175

github

ellemouton
netann: update ChanAnn2 validation to work for P2WSH channels

This commit expands the ChannelAnnouncement2 validation for the case
where it is announcing a P2WSH channel.
Pull Request #9175: lnwire+netann: update structure of g175 messages to be pure TLV

6 of 314 new or added lines in 9 files covered. (1.91%)

99 existing lines in 18 files now uncovered.

98794 of 198470 relevant lines covered (49.78%)

2.07 hits per line

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

68.75
/build/log_shutdown.go
1
package build
2

3
import (
4
        "github.com/btcsuite/btclog"
5
)
6

7
// ShutdownLogger wraps an existing logger with a shutdown function which will
8
// be called on Critical/Criticalf to prompt shutdown.
9
type ShutdownLogger struct {
10
        btclog.Logger
11
        shutdown func()
12
}
13

14
// NewShutdownLogger creates a shutdown logger for the log provided which will
15
// use the signal package to request shutdown on critical errors.
16
func NewShutdownLogger(logger btclog.Logger, shutdown func()) *ShutdownLogger {
4✔
17
        return &ShutdownLogger{
4✔
18
                Logger:   logger,
4✔
19
                shutdown: shutdown,
4✔
20
        }
4✔
21
}
4✔
22

23
// Criticalf formats message according to format specifier and writes to
24
// log with LevelCritical. It will then call the shutdown logger's shutdown
25
// function to prompt safe shutdown.
26
//
27
// Note: it is part of the btclog.Logger interface.
28
func (s *ShutdownLogger) Criticalf(format string, params ...interface{}) {
3✔
29
        s.Logger.Criticalf(format, params...)
3✔
30
        s.Logger.Info("Sending request for shutdown")
3✔
31
        s.shutdown()
3✔
32
}
3✔
33

34
// Critical formats message using the default formats for its operands
35
// and writes to log with LevelCritical. It will then call the shutdown
36
// logger's shutdown function to prompt safe shutdown.
37
//
38
// Note: it is part of the btclog.Logger interface.
UNCOV
39
func (s *ShutdownLogger) Critical(v ...interface{}) {
×
UNCOV
40
        s.Logger.Critical(v)
×
UNCOV
41
        s.Logger.Info("Sending request for shutdown")
×
UNCOV
42
        s.shutdown()
×
UNCOV
43
}
×
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