rpc: don't count pending channels in total channel balance

This commit is contained in:
Olaoluwa Osuntokun 2017-05-04 15:25:05 -07:00
parent e1152148b7
commit 54177557be
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -776,7 +776,9 @@ func (r *rpcServer) ChannelBalance(ctx context.Context,
var balance btcutil.Amount
for _, channel := range channels {
balance += channel.OurBalance
if !channel.IsPending {
balance += channel.OurBalance
}
}
return &lnrpc.ChannelBalanceResponse{Balance: int64(balance)}, nil