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)); } }
public PegGateway(BitcoinClient bitcoinClient, TedchainClient tedChainClient, ILogger logger) { this.BitcoinClient = bitcoinClient; this.TedchainClient = tedChainClient; this.logger = logger; }