lntest+rpcserver: ignore chanfitness.ErrPeerNotFound in rpc

Similar to how we handle `chanfitness.ErrChannelNotFound`, we now also
ignore the `ErrPeerNotFound`. This is needed as previously we will
always see the peer in the channel event store given it'd added when
connected. This is no longer the case as we only add the peer to the map
when the channel is added.
This commit is contained in:
yyforyongyu
2025-09-15 17:02:20 +08:00
parent 6c56f33a70
commit 22fddd626b

View File

@@ -5080,14 +5080,19 @@ func createRPCOpenChannel(ctx context.Context, r *rpcServer,
// being notified of it.
outpoint := dbChannel.FundingOutpoint
info, err := r.server.chanEventStore.GetChanInfo(outpoint, peer)
switch err {
switch {
// If the store does not know about the peer, we just log it.
case errors.Is(err, chanfitness.ErrPeerNotFound):
rpcsLog.Warnf("peer: %v not found by channel event store",
peer)
// If the store does not know about the channel, we just log it.
case chanfitness.ErrChannelNotFound:
rpcsLog.Infof("channel: %v not found by channel event store",
case errors.Is(err, chanfitness.ErrChannelNotFound):
rpcsLog.Warnf("channel: %v not found by channel event store",
outpoint)
// If we got our channel info, we further populate the channel.
case nil:
case err == nil:
channel.Uptime = int64(info.Uptime.Seconds())
channel.Lifetime = int64(info.Lifetime.Seconds())