routerrpc: check payaddr before using for probing#9134
routerrpc: check payaddr before using for probing#9134Roasbeef merged 4 commits intolightningnetwork:masterfrom
Conversation
|
Important Review skippedAuto reviews are limited to specific labels. Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
d937117 to
8976daa
Compare
d4580da to
766cf77
Compare
Since it is allowed to not be set and so can lead to nil deref panics if it is a pointer.
766cf77 to
d752ab0
Compare
Also add atomic start and stop vars to prevent close of a closed channel.
959a785 to
8663950
Compare
yyforyongyu
left a comment
There was a problem hiding this comment.
Thanks for the quick fix!
| // Start starts the service. | ||
| func (s *HtlcModificationInterceptor) Start() error { | ||
| if !s.started.CompareAndSwap(false, true) { | ||
| return nil |
There was a problem hiding this comment.
nit: add debug log like others?
| if err := s.invoices.Stop(); err != nil { | ||
| srvrLog.Warnf("failed to stop invoices: %v", err) | ||
| } | ||
| if err := s.interceptableSwitch.Stop(); err != nil { |
As in other places where we extract and use the payment address from an invoice, we first check that it is set before dereferencing it.