rpcserver: fix pendingchannels panic
This commit is contained in:
parent
630916b323
commit
69faebfcae
@ -762,12 +762,17 @@ func (r *rpcServer) PendingChannels(ctx context.Context,
|
|||||||
if includeOpen {
|
if includeOpen {
|
||||||
pendingOpenChans := r.server.fundingMgr.PendingChannels()
|
pendingOpenChans := r.server.fundingMgr.PendingChannels()
|
||||||
for _, pendingOpen := range pendingOpenChans {
|
for _, pendingOpen := range pendingOpenChans {
|
||||||
|
channelPointStr := "<non initialized yet>"
|
||||||
|
if pendingOpen.channelPoint != nil {
|
||||||
|
channelPointStr = pendingOpen.channelPoint.String()
|
||||||
|
}
|
||||||
|
|
||||||
// TODO(roasbeef): add confirmation progress
|
// TODO(roasbeef): add confirmation progress
|
||||||
pub := pendingOpen.identityPub.SerializeCompressed()
|
pub := pendingOpen.identityPub.SerializeCompressed()
|
||||||
pendingChan := &lnrpc.PendingChannelResponse_PendingChannel{
|
pendingChan := &lnrpc.PendingChannelResponse_PendingChannel{
|
||||||
PeerId: pendingOpen.peerId,
|
PeerId: pendingOpen.peerId,
|
||||||
IdentityKey: hex.EncodeToString(pub),
|
IdentityKey: hex.EncodeToString(pub),
|
||||||
ChannelPoint: pendingOpen.channelPoint.String(),
|
ChannelPoint: channelPointStr,
|
||||||
Capacity: int64(pendingOpen.capacity),
|
Capacity: int64(pendingOpen.capacity),
|
||||||
LocalBalance: int64(pendingOpen.localBalance),
|
LocalBalance: int64(pendingOpen.localBalance),
|
||||||
RemoteBalance: int64(pendingOpen.remoteBalance),
|
RemoteBalance: int64(pendingOpen.remoteBalance),
|
||||||
|
Loading…
Reference in New Issue
Block a user