rpc: don't show pending channel in the ListChannels RPC call
With the concept of open/pending channels on disk, we now will no longer show channels under ListChannels that are still pending. This fixes a slight existing bug wherein channels that weren’t yet open would be listed in this RPC call since we write to disk immediately after broadcasting the funding transaction.
This commit is contained in:
parent
f0c13c5a15
commit
178f561a2a
@ -814,6 +814,10 @@ func (r *rpcServer) ListChannels(ctx context.Context,
|
|||||||
len(dbChannels))
|
len(dbChannels))
|
||||||
|
|
||||||
for _, dbChannel := range dbChannels {
|
for _, dbChannel := range dbChannels {
|
||||||
|
if dbChannel.IsPending {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
nodePub := dbChannel.IdentityPub.SerializeCompressed()
|
nodePub := dbChannel.IdentityPub.SerializeCompressed()
|
||||||
nodeID := hex.EncodeToString(nodePub)
|
nodeID := hex.EncodeToString(nodePub)
|
||||||
chanPoint := dbChannel.ChanID
|
chanPoint := dbChannel.ChanID
|
||||||
|
Loading…
Reference in New Issue
Block a user