mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 14:17:56 +01:00
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:
13
rpcserver.go
13
rpcserver.go
@@ -5080,14 +5080,19 @@ func createRPCOpenChannel(ctx context.Context, r *rpcServer,
|
|||||||
// being notified of it.
|
// being notified of it.
|
||||||
outpoint := dbChannel.FundingOutpoint
|
outpoint := dbChannel.FundingOutpoint
|
||||||
info, err := r.server.chanEventStore.GetChanInfo(outpoint, peer)
|
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.
|
// If the store does not know about the channel, we just log it.
|
||||||
case chanfitness.ErrChannelNotFound:
|
case errors.Is(err, chanfitness.ErrChannelNotFound):
|
||||||
rpcsLog.Infof("channel: %v not found by channel event store",
|
rpcsLog.Warnf("channel: %v not found by channel event store",
|
||||||
outpoint)
|
outpoint)
|
||||||
|
|
||||||
// If we got our channel info, we further populate the channel.
|
// If we got our channel info, we further populate the channel.
|
||||||
case nil:
|
case err == nil:
|
||||||
channel.Uptime = int64(info.Uptime.Seconds())
|
channel.Uptime = int64(info.Uptime.Seconds())
|
||||||
channel.Lifetime = int64(info.Lifetime.Seconds())
|
channel.Lifetime = int64(info.Lifetime.Seconds())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user