public BlockChainContract GetBlockChain()
        {
            if (client == null)
            {
                client = new DispatcherService.DispatcherClient();
            }

            List <Block> bc = client.GetBlockChain().ToList();

            return(new BlockChainContract {
                Blocks = bc
            });
        }
        public void SetTransaction(int senderAccountId, int receiverAccountId, int amt)
        {
            try
            {
                if (client == null)
                {
                    client = new DispatcherService.DispatcherClient();
                }

                client.SetTransaction(senderAccountId, receiverAccountId, amt);
            }
            catch (Exception)
            {
                throw;
            }

            /*
             * lock (locker)
             * {
             *  var inactiveClients = new List<string>();
             *  foreach (var client in clients)
             *  {
             *      if (client.Key != exchangeRequest.ClientName)
             *      {
             *          try
             *          {
             *              client.Value.BroadcastTransectionToClient(exchangeRequest);
             *          }
             *          catch (Exception ex)
             *          {
             *              inactiveClients.Add(client.Key);
             *          }
             *      }
             *  }
             *
             *  if (inactiveClients.Count > 0)
             *  {
             *      foreach (var client in inactiveClients)
             *      {
             *          clients.Remove(client);
             *      }
             *  }
             * }
             */
        }