예제 #1
0
        public async Task BitcoinToTedChain()
        {
            while (true)
            {
                try
                {
                    IList <InboundTransaction> transactions = await this.BitcoinClient.GetUnspentOutputs();

                    foreach (InboundTransaction transaction in transactions)
                    {
                        try
                        {
                            await TedchainClient.AddAsset(transaction);

                            await BitcoinClient.MoveToStorage(transaction);
                        }
                        catch (Exception exception)
                        {
                            this.logger.LogError($"An exception occurred: {exception.ToString()}");
                        }
                    }
                }
                catch (Exception exception)
                {
                    this.logger.LogError($"An exception occurred: {exception.ToString()}");
                }

                await Task.Delay(TimeSpan.FromSeconds(5));
            }
        }
예제 #2
0
 public PegGateway(BitcoinClient bitcoinClient, TedchainClient tedChainClient, ILogger logger)
 {
     this.BitcoinClient  = bitcoinClient;
     this.TedchainClient = tedChainClient;
     this.logger         = logger;
 }