Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main

Check warning on line 1 in main.go

View workflow job for this annotation

GitHub Actions / Lint

should have a package comment

import (
"context"
Expand All @@ -13,6 +13,7 @@
"github.com/aftermath2/acceptlnd/lightning"

"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/pkg/errors"
)

Expand Down Expand Up @@ -114,7 +115,19 @@
}
peer, err := client.GetNodeInfo(ctx, getPeerInfoReq)
if err != nil {
return resp, errors.New("Internal server error")
if req.ChannelFlags == uint32(lnwire.FFAnnounceChannel) {
return resp, errors.New("Internal server error")
}

slog.Warn("Couldn't get peer node information, likely because it has no public channels. Using request details")
peer = &lnrpc.NodeInfo{
Node: &lnrpc.LightningNode{
PubKey: hex.EncodeToString(req.NodePubkey),
},
TotalCapacity: 0,
Channels: []*lnrpc.ChannelEdge{},
NumChannels: 0,
}
}
slog.Debug("Peer node information", slog.Any("node", peer))

Expand Down
Loading