From 178f561a2a11c49bad9e07501866f650ff29df33 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Fri, 24 Feb 2017 16:12:24 -0800 Subject: [PATCH] rpc: don't show pending channel in the ListChannels RPC call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- rpcserver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rpcserver.go b/rpcserver.go index adb7387f..6069c9f5 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -814,6 +814,10 @@ func (r *rpcServer) ListChannels(ctx context.Context, len(dbChannels)) for _, dbChannel := range dbChannels { + if dbChannel.IsPending { + continue + } + nodePub := dbChannel.IdentityPub.SerializeCompressed() nodeID := hex.EncodeToString(nodePub) chanPoint := dbChannel.ChanID