Example #1
0
        /// <inheritdoc />
        public async Task <ClassicTumblerParameters> ConnectToTumblerAsync(Uri serverAddress)
        {
            this.tumblerService    = new TumblerService(serverAddress);
            this.TumblerParameters = await this.tumblerService.GetClassicTumblerParametersAsync();

            if (this.TumblerParameters.Network != this.network)
            {
                throw new Exception($"The tumbler is on network {this.TumblerParameters.Network} while the wallet is on network {this.network}.");
            }

            if (this.tumblingState == null)
            {
                this.tumblingState = new TumblingState();
            }

            // update and save the state
            this.tumblingState.TumblerParameters = this.TumblerParameters;
            this.tumblingState.Save();

            return(this.TumblerParameters);
        }
Example #2
0
        /// <inheritdoc />
        public async Task <ClassicTumblerParameters> ConnectToTumblerAsync(Uri serverAddress)
        {
            this.tumblerService    = new TumblerService(serverAddress);
            this.TumblerParameters = await this.tumblerService.GetClassicTumblerParametersAsync();

            if (this.TumblerParameters.Network != this.network)
            {
                throw new Exception($"The tumbler is on network {this.TumblerParameters.Network} while the wallet is on network {this.network}.");
            }

            // load the current tumbling state fromt he file system
            this.tumblingState.LoadStateFromMemory();

            // update and save the state
            this.tumblingState.TumblerUri        = serverAddress;
            this.tumblingState.TumblerParameters = this.TumblerParameters;
            this.tumblingState.SetClients(this.tumblerService);
            this.tumblingState.Save();

            return(this.TumblerParameters);
        }
Example #3
0
 public void SetClients(ITumblerService tumblerService)
 {
     this.AliceClient = tumblerService;
     this.BobClient   = tumblerService;
 }