rpc+routing: fix panic when channel edge but no edge info in db
This commit is contained in:
parent
384fe61e73
commit
5560f032f6
@ -831,6 +831,8 @@ func (r *ChannelRouter) syncChannelGraph(syncReq *syncRequest) error {
|
|||||||
chanID = lnwire.NewChanIDFromInt(e1.ChannelID)
|
chanID = lnwire.NewChanIDFromInt(e1.ChannelID)
|
||||||
case e2 != nil:
|
case e2 != nil:
|
||||||
chanID = lnwire.NewChanIDFromInt(e2.ChannelID)
|
chanID = lnwire.NewChanIDFromInt(e2.ChannelID)
|
||||||
|
case e1 == nil && e2 == nil:
|
||||||
|
return nil
|
||||||
default:
|
default:
|
||||||
chanID = lnwire.NewChanIDFromInt(e1.ChannelID)
|
chanID = lnwire.NewChanIDFromInt(e1.ChannelID)
|
||||||
}
|
}
|
||||||
|
@ -1601,6 +1601,8 @@ func (r *rpcServer) GetNetworkInfo(context.Context, *lnrpc.NetworkInfoRequest) (
|
|||||||
chanCapacity = c2.Capacity
|
chanCapacity = c2.Capacity
|
||||||
case c2 == nil:
|
case c2 == nil:
|
||||||
chanCapacity = c1.Capacity
|
chanCapacity = c1.Capacity
|
||||||
|
case c1 == nil && c2 == nil:
|
||||||
|
return nil
|
||||||
default:
|
default:
|
||||||
chanCapacity = c1.Capacity
|
chanCapacity = c1.Capacity
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user